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

            Bug ID: 35138
           Summary: Confusing error message with missing semicolon and
                    assert
           Product: clang
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: kparz...@codeaurora.org
                CC: llvm-bugs@lists.llvm.org

I just ran into this. This is not really a bug as much as it's an unfortunate
consequence of macro expansion. Maybe it's possible for clang to detect this as
"missing semicolon" anyway...

--- confusing.c ---
#include <assert.h>

int sammy(void);

int danny() {
  int x = sammy()
  assert(x != 0);
  return x+1;
}
-------------------

$ clang -c confusing.c
confusing.c:7:3: error: called object type 'int' is not a function or function
      pointer
  assert(x != 0);
  ^
/usr/include/assert.h:89:3: note: expanded from macro 'assert'
  ((expr)                                                               \
  ^
1 error generated.

-- 
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