https://bugs.llvm.org/show_bug.cgi?id=45394

            Bug ID: 45394
           Summary: __attribute__((warn_result_unused)) broken for GNU C
                    asm statement
           Product: clang
           Version: trunk
          Hardware: PC
               URL: https://github.com/ClangBuiltLinux/linux/issues/968
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]
            Blocks: 4068

__attribute__((warn_unused_result))
static inline int foo(void) {
    return 42;
}

#define bar() ({\
  foo(); \
})

void baz(void) {
    bar();
}
warns in GCC (-Wunused-result), but not in Clang. Note that if bar() calls
foo() twice, Clang will warn for the first, but still not the return value.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=4068
[Bug 4068] [Meta] Compiling the Linux kernel with clang
-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to