kern/179949: clang-3.2 cpp inserts extra white spaces to certain macro values

Jukka Ukkonen jau at iki.fi
Tue Jun 25 08:10:01 UTC 2013


>Number:         179949
>Category:       kern
>Synopsis:       clang-3.2 cpp inserts extra white spaces to certain macro values
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 25 08:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Jukka Ukkonen
>Release:        9.1-STABLE
>Organization:
-----
>Environment:
FreeBSD sleipnir 9.1-STABLE FreeBSD 9.1-STABLE #0 r252194M: Tue Jun 25 09:01:34 EEST 2013     root at sleipnir:/usr/obj/usr/src/sys/Sleipnir  amd64
>Description:
The cpp version installed with clang-3.2 breaks all macros which include a dash
in the value by inserting an extra space character before the dash.

This problem was found when ipfw configuration files which had been working just
fine with the gcc version of cpp suddenly started experiencing hiccups.

Assume there is a macro specifying typical windows ports and
an ipfw rule using that macro ...

#define PORTS 137-139, 445
..
add 03020 deny log logamount 0 { tcp or udp } from any to any PORTS via em1

Clang-3.2 version of cpp does this...

add 03020 deny log logamount 0 { tcp or udp } from any to any 137 -139, 445 via em1
--------------------------------------------------------------+++^+++++++++

while the cleaner approach produces ...

add 03020 deny log logamount 0 { tcp or udp } from any to any 137-139, 445 via em1

Clang-3.3 version of cpp seems to behave better leaving the macro values
untouched/unmodified.


>How-To-Repeat:
See full description above.
>Fix:
Upgrade clang-3.2 and related tools to clang-3.3 and tools.


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list