[LLVMbugs] [Bug 4283] New: Clang's preprocessor doesn' t support multibyte character constants

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri May 29 05:52:58 PDT 2009


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

           Summary: Clang's preprocessor doesn't support multibyte character
                    constants
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: preprocessor
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 3696


Believe it or not, GCC accepts this piece of code:

#include <stdio.h>

#if (('1234' >> 24) == '1')
# define ENDIAN "little"
#elif (('4321' >> 24) == '1')
# define ENDIAN "big"
#else
# define ENDIAN "unknown"
#endif

int
main(int argc, char *argv[])
{

        puts("I am " ENDIAN " endian!");
}

When built with GCC, it prints "I am little endian!" on my AMD64 box, while a
Clang built binary prints "I am unknown endian!"

This construct is used by http://www.speakfreely.org/


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