Discussion:
Current pcc does not understand #pragma after whitespace
Isaac Dunham
2012-11-28 06:37:58 UTC
Permalink
Hello all,
I tried building musl (0.9.8) with pcc (the Nov. 9 version) and found that it failed to build. After a bit of testing, I discovered that
#pragma ... /*in src/fenv/feupdateenv.c */
was breaking the buld because of the whitespace preceding the #pragma directive.
I've attached a workaround in musl.
Would it be possible to fix this in pcc? I suspect that a number of programs don't expect this...

Other files affected are src/math/fma*.c & src/math/nearbyint*.c

Once I patch that, build time (time make >/dev/null; agrees with the clock) for a full shared + static set comes out to ~1 min:
$ time make >/dev/null

real 0m56.694s
user 0m26.797s
sys 0m25.470s

And the shared library works.
--
Isaac Dunham <***@lavabit.com>
Szabolcs Nagy
2012-11-28 10:06:10 UTC
Permalink
Post by Isaac Dunham
I tried building musl (0.9.8) with pcc (the Nov. 9 version) and found that it failed to build. After a bit of testing, I discovered that
#pragma ... /*in src/fenv/feupdateenv.c */
was breaking the buld because of the whitespace preceding the #pragma directive.
I've attached a workaround in musl.
the way it is done is directly copy pasted from
the example present in the standard

http://port70.net/~nsz/c/c11/n1570.html#7.6.1p3

so i think pcc should be fixed

i guess we can remove the pragma from feupdateenv
as there is no fp operations (or add it to the
other fe*.c files as well for consistency)
Iain Hibbert
2012-11-29 10:01:24 UTC
Permalink
Post by Szabolcs Nagy
Post by Isaac Dunham
I tried building musl (0.9.8) with pcc (the Nov. 9 version) and found that it failed to build. After a bit of testing, I discovered that
#pragma ... /*in src/fenv/feupdateenv.c */
was breaking the buld because of the whitespace preceding the #pragma directive.
I've attached a workaround in musl.
the way it is done is directly copy pasted from
the example present in the standard
http://port70.net/~nsz/c/c11/n1570.html#7.6.1p3
so i think pcc should be fixed
I committed a fix for this

iain

* I had previously thought about investigating whether it would be better
to teach ccom to understand _Pragma() instead of #pragma, and converting
them the other way. It may be better, my thought went, for line count
matching since each _Pragma() converted to #pragma requires extra lines
inserted to the cpp output..

Loading...