Commit 2a8dd0c0 authored by Stefan Behnel's avatar Stefan Behnel

Exclude 'const' globals from star-importing since they can't get assigned anyway.

Closes #2621.
parent 1644e44c
...@@ -105,6 +105,10 @@ Bugs fixed ...@@ -105,6 +105,10 @@ Bugs fixed
* Generator expressions and lambdas failed to compile in ``@cfunc`` functions. * Generator expressions and lambdas failed to compile in ``@cfunc`` functions.
(Github issue #459) (Github issue #459)
* Global names with ``const`` types were not excluded from star-import assignments
which could lead to invalid C code.
(Github issue #2621)
* Several internal function signatures were fixed that lead to warnings in gcc-8. * Several internal function signatures were fixed that lead to warnings in gcc-8.
(Github issue #2363) (Github issue #2363)
......
...@@ -2238,7 +2238,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -2238,7 +2238,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("if (0);") # so the first one can be "else if" code.putln("if (0);") # so the first one can be "else if"
msvc_count = 0 msvc_count = 0
for name, entry in sorted(env.entries.items()): for name, entry in sorted(env.entries.items()):
if entry.is_cglobal and entry.used: if entry.is_cglobal and entry.used and not entry.type.is_const:
msvc_count += 1 msvc_count += 1
if msvc_count % 100 == 0: if msvc_count % 100 == 0:
code.putln("#ifdef _MSC_VER") code.putln("#ifdef _MSC_VER")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment