[LLVMbugs] [Bug 1903] New: __func__ should be of type char[], not char*

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Jan 9 18:37:47 PST 2008


           Summary: __func__ should be of type char[], not char*
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu

int abcdefghi12(void) {
  return sizeof(__func__);
should return 12 because the name of the function is 11 characters long, but
clang incorrectly comes up with 4.

void a(void) {
  static char* s = __func__;
should not be a compile error, because __func__ is a constant array, and
void abcdefghi12(void) {
  const char (*ss)[12] = &__func__;
should not be a compile error because __func__ is an array.

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.

More information about the llvm-bugs mailing list