diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-07-21 15:02:32 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-07-21 15:02:32 +0200 |
commit | 68df90c91ab67a32fc666bf18798bba9ae6c5f9d (patch) | |
tree | 884edfdf7369113805408f21f95c4b0c507c78bc /backend/Bounds.v | |
parent | b1e369b98b6611d71b0d85115c1205fdbdbbece7 (diff) | |
download | compcert-68df90c91ab67a32fc666bf18798bba9ae6c5f9d.tar.gz compcert-68df90c91ab67a32fc666bf18798bba9ae6c5f9d.zip |
Revised handling of block-scoped extern declarations
Currently, CompCert incorrectly handles 'extern' and function
declarations within a block. For example:
int main(void)
{
{
extern int i;
i = 0;
}
{
extern float i;
i = 10;
}
}
CompCert fails to detect the inconsistent declarations of "i" in the
two blocks, simply because the first declaration is not in scope when
the second declaration is processed.
This commit changes the elaboration of file-scope declarations,
block-scope "extern" declarations and block-scope function
declarations so that they are checked against possible earlier
declarations found in the already-elaborated top-level declarations,
instead of in the current typing environment.
Owing to the lifting of block-scoped extern and static declarations to
the top-level already performed by the elaboration pass, the
already-elaborated top-level declarations give an accurate view of the
declarations of variables with internal or external linkage already
encountered and processed, even if they are not currently in scope.
Diffstat (limited to 'backend/Bounds.v')
0 files changed, 0 insertions, 0 deletions