aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cutil.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2018-05-24 16:01:30 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-05-26 11:05:13 +0200
commit9dc1505c01a5748cdd5cac9d978645e2fbc0773c (patch)
tree6a75c4cb0b096b5744603e37dc4491ac324da8db /cparser/Cutil.ml
parent2b2585f39000f7000f296bc5b35c14e70f0c31fe (diff)
downloadcompcert-kvx-9dc1505c01a5748cdd5cac9d978645e2fbc0773c.tar.gz
compcert-kvx-9dc1505c01a5748cdd5cac9d978645e2fbc0773c.zip
Preserve storage class for functions declared within a block
This is a follow-up to the introduction of the Storage_auto storage class in commit 760e422. For functions declared within a block, we used to set their storage class to "extern": { { int f(void); ---> extern int f(void); } } This helped enter_or_refine_ident understand that those declarations have linkage. Now that we have Storage_auto, this commit teaches enter_or_refine_ident that local declarations have no linkage if auto or static, and have linkage if extern or default. Then, there is no need to change storage class to extern for locally-declared functions. In turn, this improves the "extern-after-definition" warning recently introduced, avoiding a bizarre warning in the following case: int foo(void){return 0;} int main(void){ int foo(void); return foo(); }
Diffstat (limited to 'cparser/Cutil.ml')
0 files changed, 0 insertions, 0 deletions