On May 22, 2014, at 11:40 AM, Richard Smith <[email protected]> wrote:
>
> Another problem with our current model is that we build a broken
> redeclaration chain (the local declaration is marked as being a redeclaration
> of the implicitly-declared builtin, which it isn't). This leads to other
> bugs; for instance:
>
> void f() { int memcpy(void); } void g() { memcpy(0,0,0); }
>
> ... misses the "implicitly declaring library function" warning.
Interesting point. Currently, we create a built-in declaration of “memcpy” and
make local declaration as its redeclaration.
Should we just not create the implicit built-in declaration when user
declaration is local? If we do this,
then the missing warning you mentioned will come out (and my bug gets fixed).
But, we will miss the warning
about "incompatible redeclaration of library function ‘memcpy’” on local
“redeclaration”.
Which, I think, is ok as it is no longer a redeclaration.
Am I reading you correctly?
- Fariborz
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits