[LLVMbugs] [Bug 5390] New: Problems in __builtin_offsetof locations

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Nov 4 05:49:46 PST 2009


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

           Summary: Problems in __builtin_offsetof locations
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: parser
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: abramobagnara at tin.it
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3761)
 --> (http://llvm.org/bugs/attachment.cgi?id=3761)
Source used to show the problems

The attached C source show two different problems:

$ llvm_new/Debug/bin/clang-cc -W -Wall bug_clang2.c
bug_clang2.c:11:7: error: too many arguments to function call
  fun(333);
  ~~~ ^~~
bug_clang2.c:12:7: error: too many arguments to function call
  fun(__builtin_offsetof(struct s, g));
  ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bug_clang2.c:13:7: error: too many arguments to function call
  fun(__builtin_offsetof(struct s, f));
  ~~~ ^
3 diagnostics generated.


1) As seen in diagnostic for line 12, the end location of
__builtin_offsetof is not the right paren but the end of location of
subexpression (like in all other prefix unary operators). This is wrong
for __builtin_offsetof.

2) Worse in diagnostic for line 13, the end location of
__builtin_offsetof is invalid (here I don't fully understand how this
happens).


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