[LLVMbugs] [Bug 6282] New: Multiple inclusion elimination is too aggressive
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Thu Feb 11 17:17:28 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=6282
Summary: Multiple inclusion elimination is too aggressive
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: preprocessor
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: dgregor at apple.com
CC: llvmbugs at cs.uiuc.edu
Blocks: 6023
In the following example, Clang's multiple-inclusion detection is suppressing
the second inclusion of "t.h", so we get different results from GCC. This
actually manifests itself in a Boost bug, since Boost often uses "vertical
repetition" (i.e., including the same file many times with different macro
definitions) for its preprocessor metaprogramming.
terfin:Projects dgregor$ cat t.h
#ifndef ITERATING
void NAME(int) { }
#else
void NAME(int) { }
#endif
terfin:Projects dgregor$ cat t.c
#define ITERATING 1
#define NAME foo
#include "t.h"
#include "t.h"
# 1 "t.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "t.c"
# 1 "t.h" 1
void foo(int) { }
# 4 "t.c" 2
# 1 "t.h" 1
void foo(int) { }
# 5 "t.c" 2
# 1 "t.c"
# 1 "t.c" 1
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 120 "<built-in>" 3
# 120 "<command line>" 1
# 121 "<built-in>" 2
# 1 "t.c" 2
# 1 "./t.h" 1
void foo(int) { }
# 4 "t.c" 2
--
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