[LLVMbugs] [Bug 18822] New: VS2012 preprocessor string concatenation incompatibility

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 12 14:53:49 PST 2014


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

            Bug ID: 18822
           Summary: VS2012 preprocessor string concatenation
                    incompatibility
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: ab at php.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The error happens when including several headers like winsock2.h or winnt.h,
but it's laying deeper in the header driverspecs.h . Here's a snippet from the
static analyzer approach could be found here
https://github.com/weltling/clang-php-checker/tree/win32_and_more

In file included from C:\php-sdk\phpmaster\vc11\x64\php-src\win32\time.c:19:
In file included from C:\php-sdk\phpmaster\vc11\x64\php-src\win32/time.h:17:
In file included from C:\php-sdk\phpmaster\vc11\x64\php-src\main\php.h:34:
In file included from C:\php-sdk\phpmaster\vc11\x64\php-src\Zend\zend.h:42:
In file included from
C:\php-sdk\phpmaster\vc11\x64\php-src\Zend/zend_config.w32.h:38:
In file included from C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.1A\Include\winsock2.h:66:
In file included from C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.1A\Include\windows.h:155:
In file included from C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.1A\Include\windef.h:177:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include\winnt.h:1202:1:
error: pasting formed '(__drv_nop', an invalid preprocessing token
__drv_functionClass(EXCEPTION_ROUTINE)
^
C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.1A\Include\driverspecs.h:358:3: note: expanded from macro
'__drv_functionClass'
                __drv_out(__drv_declspec("SAL_functionClass(\""#x"\")"))
                ^
C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.1A\Include\driverspecs.h:279:49: note: expanded from macro
'__drv_out'
        #define __drv_out(annotes) __post __$drv_group(##__drv_nop(annotes))

A simpler reproduce case, thanks to rnk from #llvm, is

11:41:41 PM) rnk: #define foo(x) puts(##x)
(11:41:41 PM) rnk: foo(y)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140212/f65fe422/attachment.html>


More information about the llvm-bugs mailing list