summaryrefslogtreecommitdiff
path: root/cfrontend
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-05-15 07:27:56 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-05-15 07:27:56 +0000
commitb30f9ce6a87e94b34c1420323e445c07eee8305e (patch)
treeda5f7a1b52ed61b4dda6d01b8c1a71193279601e /cfrontend
parentedc00e0c90a5598f653add89f42a095d8ee1b629 (diff)
- Re-added support for "__func__" identifier as per ISO C99.
- Support for empty structs and unions - Better handling of "extern" and "extern inline" function definitions. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2493 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend')
-rw-r--r--cfrontend/C2C.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml
index 8799bc0..d389d0a 100644
--- a/cfrontend/C2C.ml
+++ b/cfrontend/C2C.ml
@@ -1069,9 +1069,13 @@ let convertProgram p =
let atom_is_static a =
try
let i = Hashtbl.find decl_atom a in
- i.a_storage = C.Storage_static || i.a_inline
- (* inline functions can remain in generated code, but at least
- let's not make them global *)
+ (* inline functions can remain in generated code, but should not
+ be global, unless explicitly marked "extern" *)
+ match i.a_storage with
+ | C.Storage_default -> i.a_inline
+ | C.Storage_extern -> false
+ | C.Storage_static -> true
+ | C.Storage_register -> false (* should not happen *)
with Not_found ->
false