[LLVMbugs] [Bug 2427] New: clang redefines size_t silently but then complains

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jun 10 08:28:40 PDT 2008


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

           Summary: clang redefines size_t silently but then complains
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: filcab at gmail.com
                CC: llvmbugs at cs.uiuc.edu


clang doesn't compile the following code, although gcc happily compiles:
--------------
#include <stddef.h>
extern void* f(void** p, size_t s);

#include <stdlib.h>


void* f(void** p, size_t s)
{
}
--------------

I think the problem is with the redefinition of size_t in stdlib.h (a system
header) to something different from what is defined in stddef.h.

In Mac OS X, clang complains:
[filcab at farnsworth ~] $ clang b.c
b.c:7:7: error: conflicting types for 'f'
void* f(void** p, size_t s)
      ^
b.c:2:14: error: previous declaration is here
extern void* f(void** p, size_t s);
             ^
2 diagnostics generated.


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