Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line splicing should be applied everywhere #21

Open
gilgamec opened this issue Apr 8, 2019 · 0 comments
Open

Line splicing should be applied everywhere #21

gilgamec opened this issue Apr 8, 2019 · 0 comments

Comments

@gilgamec
Copy link

gilgamec commented Apr 8, 2019

According to the C99 spec (section 5.1.1.2, "Translation phases"), line splicing -- gluing together lines which end with a backslash -- should be performed for every line ending in a backslash. cpphs, however, only seems to do this for lines containing cpp commands, i.e. lines starting with a #:

% cat foo.c
#define X  123\
456

int x1 = X;

int x2 = 123\
456;
% cpp foo.c
# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "foo.c"



int x1 = 123456;

int x2 = 123456;
% cpphs foo.c
#line 1 "foo.c"



int x1 = 123456;

int x2 = 123\
456;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant