cil-project / cil

C Intermediate Language
Other
348 stars 86 forks source link

cabs2cil: don't let extern inline prototypes replace definitions of… #25

Closed stephenrkell closed 6 years ago

stephenrkell commented 8 years ago

…the same function seen earlier.

Currently, if a .c file defines an extern inline function and then repeats its prototype without a definition, the definition is omitted from the .cil.c output file. This tiny patch fixes that bug.

kerneis commented 8 years ago

Can you please add a test? If you are lost in CIL's test infrastructure, please just give a minimal C program that would compile (and/or run) with your patch, but not without.

kerneis commented 8 years ago

Ah, looks like you already did that (a long time ago) in issue #14. I'll try to re-use your program from there (but it will likely be faster if you update this PR with it). Thanks a lot for the patch anyway :-)

stephenrkell commented 8 years ago

Once again my git skills have let me down... I've pushed a new commit to my fork, adding the test case that you (very reasonably) asked for. I've also pushed two unrelated commits that belong in separate pull requests. I've no idea how to exclude those two from this pull request... maybe you can cherry-pick?

kerneis commented 8 years ago

git rebase -i origin/develop followed by git push -f is generally how you solve that situation,  but I'll cherry pick,  don't worry. Thanks again for you help.

stephenrkell commented 6 years ago

I'm closing this since I have recently added a bunch more changes on my fork. They are all ready for pulling, but I'll request them one-by-one, rather than this request which is about pulling my whole develop/ branch in one go.