simplecpp icon indicating copy to clipboard operation
simplecpp copied to clipboard

content of repeated (unguarded) include placed on the same line

Open firewave opened this issue 5 months ago • 0 comments

From testsuite/clang-preprocessor-tests/print_line_include.c and uncovered by #490.

print_line_include.c

#include "print_line_include.h"
#include "print_line_include.h"

print_line_include.h

int x;

gcc -E output:

# 0 "testsuite/clang-preprocessor-tests/print_line_include.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "testsuite/clang-preprocessor-tests/print_line_include.c"
# 1 "testsuite/clang-preprocessor-tests/print_line_include.h" 1
int x;
# 2 "testsuite/clang-preprocessor-tests/print_line_include.c" 2
# 1 "testsuite/clang-preprocessor-tests/print_line_include.h" 1
int x;
# 3 "testsuite/clang-preprocessor-tests/print_line_include.c" 2

Actual:


#line 1 "testsuite/clang-preprocessor-tests/print_line_include.h"
int x ; int x ;

firewave avatar Aug 12 '25 11:08 firewave