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

            Bug ID: 38569
           Summary: dont emit -Wreturn-stack-address in single case
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: ndesaulni...@google.com
                CC: lloz...@chromium.org, llvm-bugs@lists.llvm.org,
                    srhi...@google.com

>From https://github.com/ClangBuiltLinux/linux/issues/24:

The Linux kernel uses the following construct often:

#define _THIS_IP_  ({ __label__ __here; __here: (unsigned long)&&__here; })

This produces -Wreturn-stack-address (in Clang 7+) for the label, but generates
the expected code.

I think we can detect returning the address of a label in a GNU-C-extension
statement expression, that has nothing between the label and the final
statement, and not emit the warning?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to