Skip to content

Commit

Permalink
Further refine the C2C.atom_is_external criterion in "no-common" mode
Browse files Browse the repository at this point in the history
In `-fno-common` mode, a global variable declaration such as `int x;`,
with default storage class, acts like a definition: `x` cannot be
defined in a DLL.
  • Loading branch information
xavierleroy committed Nov 21, 2024
1 parent 0df2712 commit 70e85cc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cfrontend/C2C.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ let atom_is_external a =
match Hashtbl.find decl_atom a with
| { a_defined = true } -> false
| { a_storage = C.Storage_static } -> false
| { a_storage = C.Storage_default; a_size = Some _ } -> !Clflags.option_fcommon
| _ -> true
| exception Not_found -> true

Expand Down

0 comments on commit 70e85cc

Please sign in to comment.