http://llvm.org/bugs/show_bug.cgi?id=4860

           Summary: Clang doesn't honour -Wno-attributes when applying
                    __attribute__((__warn_unused_result__)) to variables.
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The following program solicits a warning when the __warn_unused_result__
attribute is applied to a variable. gcc >= 4.1 does not emit a warning with
-Wno-attributes.

$ cat >wnoattr-var.c
__attribute__((__warn_unused_result__)) int x;

$ /opt/clang/bin/clang -c -Wall -Wno-attributes wnoattr-var.c 
wnoattr-var.c:1:16: warning: '__warn_unused_result__' attribute only applies to
function types
__attribute__((__warn_unused_result__)) int x;
               ^
1 diagnostic generated.

$ /opt/clang/bin/clang -v
clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/trunk 80665)
Target: i386-pc-solaris2.11
Thread model: posix

$ uname -a
SunOS hydra 5.11 snv_110 i86pc i386 i86pc


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to