-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclangClang issues not falling into any other categoryClang issues not falling into any other category
Description
| Bugzilla Link | 4010 |
| Resolution | FIXED |
| Resolved on | Feb 22, 2010 12:49 |
| Version | unspecified |
| OS | MacOS X |
| Attachments | Example demonstrating problem |
| Reporter | LLVM Bugzilla Contributor |
| CC | @nunoplopes,@sirainen |
Extended Description
version used: checker-186
Clang does not allow attribute((warn_unused_result)) to be applied to pointers to functions. For example:
char *(*functionPointerTest)(void) attribute((warn_unused_result));
Clang gives the following warning:
warnbug.c:8:57: warning: 'warn_unused_result' attribute only applies to function types
char *(*functionPointerTest)(void) attribute((warn_unused_result));
^
Expected behavior: You should be able to apply warn_unused_result to pointers to functions just as you would a common function prototype.
Attached is an example that demonstrates the problem. When run with scan-build gcc -c -Wall -Wextra warnbug.c, gcc correctly handles the attribute and correctly warns for the line that does not check/use the result.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclangClang issues not falling into any other categoryClang issues not falling into any other category