This is an archive of the discontinued LLVM Phabricator instance.

Add -Wno-implicit-function-declaration to a few places to work w D122983
ClosedPublic

Authored by erichkeane on Apr 6 2022, 12:04 PM.

Details

Summary

D122983 intends to make these cases a 'warning as error' in C11 and C17
modes, and an attempt to set these to C99 mode caused more failures due
to included-files no longer containing certain symbols. This patch just
adds the warning-opt-out to the tests that matter. See
https://reviews.llvm.org/D122983 for details.

Diff Detail

Event Timeline

erichkeane created this revision.Apr 6 2022, 12:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 12:04 PM
Herald added a subscriber: mgorny. · View Herald Transcript
aaron.ballman accepted this revision.Apr 6 2022, 12:41 PM

LGTM aside from the question I asked. FWIW, this is an NFC change as it only disables warnings that we know are triggered.

SingleSource/Regression/C/gcc-c-torture/execute/CMakeLists.txt
4

Should the new flag be within quotes like -w or does this not matter? (I don't know Cmake well enough to know.)

This revision is now accepted and ready to land.Apr 6 2022, 12:41 PM
erichkeane added inline comments.Apr 6 2022, 12:46 PM
SingleSource/Regression/C/gcc-c-torture/execute/CMakeLists.txt
4

I have no idea, I was following what the rest of the entries in this list ended up doing (I think this was the last I found). I suspect it doesn't matter.

cor3ntin added inline comments.
SingleSource/Regression/C/gcc-c-torture/execute/CMakeLists.txt
4

It doesn't, in the absence of spaces/semicolon, both are fine

cor3ntin accepted this revision.Apr 6 2022, 1:04 PM

@cor3ntin is correct. For consistency could you also remove the quotes around -w?

However, what use is the change, -w already disables all warnings? https://reviews.llvm.org/D122983#3426261 seems to summarize the effect of D122983, but doesn't -w still override "Warn-as-default-error"?

@cor3ntin is correct. For consistency could you also remove the quotes around -w?

+1, probably a good idea so no one else gets confused like I did.

However, what use is the change, -w already disables all warnings? https://reviews.llvm.org/D122983#3426261 seems to summarize the effect of D122983, but doesn't -w still override "Warn-as-default-error"?

-w doesn't override warn-defaults-as-error: https://godbolt.org/z/8rKGh366h

erichkeane updated this revision to Diff 421173.Apr 7 2022, 5:50 AM

Quote around "-w" removed! If this is OK, how do I commit? I've never committed to this repo before, is it hte same permission set as normal llvm?

erichkeane closed this revision.Apr 7 2022, 5:57 AM

Turns out I just have push rights! So, done! Phab won't let me edit related commits, but the commit that merged was: a87f4e4f9808a397dc4c575013142c9eac0b7eba

zibi added a subscriber: zibi.Apr 20 2022, 1:57 PM

I'm seeing this error:

MultiSource/Benchmarks/Prolangs-C/bison/symtab.c:65:3: error: call to undeclared library function 'strcpy' with type 'char *(char *, const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  strcpy(result, s);
  ^

Have you missed MultiSource/Benchmarks/Prolangs-C/bison/CMakeLists.txt to turn off the warning?

zibi added a comment.Apr 20 2022, 2:28 PM

Have you missed MultiSource/Benchmarks/Prolangs-C/bison/CMakeLists.txt to turn off the warning?

@erichkeane Erich, will you be able to provide the fix for this? Please let me know ETA so I can plan accordingly.

zibi added a comment.Apr 20 2022, 5:47 PM

Have you missed MultiSource/Benchmarks/Prolangs-C/bison/CMakeLists.txt to turn off the warning?

@erichkeane Erich, will you be able to provide the fix for this? Please let me know ETA so I can plan accordingly.

@aaron.ballman Thank you for the quick fix. It addressed my concern.