* Current pcc does not understand #pragma after whitespace
@ 2012-11-28 6:37 Isaac Dunham
2012-11-28 10:06 ` Szabolcs Nagy
0 siblings, 1 reply; 3+ messages in thread
From: Isaac Dunham @ 2012-11-28 6:37 UTC (permalink / raw)
To: pcc-list; +Cc: musl
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
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 <idunham@lavabit.com>
[-- Attachment #2: pragmas.diff --]
[-- Type: text/x-diff, Size: 2343 bytes --]
diff --git a/src/fenv/feupdateenv.c b/src/fenv/feupdateenv.c
index f45ed7c..6bc731e 100644
--- a/src/fenv/feupdateenv.c
+++ b/src/fenv/feupdateenv.c
@@ -2,7 +2,7 @@
int feupdateenv(const fenv_t *envp)
{
- #pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS ON
int ex = fetestexcept(FE_ALL_EXCEPT);
fesetenv(envp);
feraiseexcept(ex);
diff --git a/src/math/fma.c b/src/math/fma.c
index 17f1cdc..56a269f 100644
--- a/src/math/fma.c
+++ b/src/math/fma.c
@@ -89,7 +89,7 @@ static int getexp(long double x)
double fma(double x, double y, double z)
{
- #pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS ON
long double hi, lo1, lo2, xy;
int round, ez, exy;
diff --git a/src/math/fmaf.c b/src/math/fmaf.c
index a1c7f4f..fd97f78 100644
--- a/src/math/fmaf.c
+++ b/src/math/fmaf.c
@@ -37,7 +37,7 @@
*/
float fmaf(float x, float y, float z)
{
- #pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS ON
double xy, result;
uint32_t hr, lr;
diff --git a/src/math/fmal.c b/src/math/fmal.c
index ccbe434..4b57ea6 100644
--- a/src/math/fmal.c
+++ b/src/math/fmal.c
@@ -162,7 +162,7 @@ static inline struct dd dd_mul(long double a, long double b)
*/
long double fmal(long double x, long double y, long double z)
{
- #pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS ON
long double xs, ys, zs, adj;
struct dd xy, r;
int oround;
diff --git a/src/math/nearbyint.c b/src/math/nearbyint.c
index f4e8aac..b0ffcc8 100644
--- a/src/math/nearbyint.c
+++ b/src/math/nearbyint.c
@@ -6,7 +6,7 @@
double nearbyint(double x)
{
#ifdef FE_INEXACT
- #pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS ON
int e;
e = fetestexcept(FE_INEXACT);
diff --git a/src/math/nearbyintf.c b/src/math/nearbyintf.c
index 092e9ff..c96002b 100644
--- a/src/math/nearbyintf.c
+++ b/src/math/nearbyintf.c
@@ -4,7 +4,7 @@
float nearbyintf(float x)
{
#ifdef FE_INEXACT
- #pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS ON
int e;
e = fetestexcept(FE_INEXACT);
diff --git a/src/math/nearbyintl.c b/src/math/nearbyintl.c
index 8285249..7d97b66 100644
--- a/src/math/nearbyintl.c
+++ b/src/math/nearbyintl.c
@@ -11,7 +11,7 @@ long double nearbyintl(long double x)
long double nearbyintl(long double x)
{
#ifdef FE_INEXACT
- #pragma STDC FENV_ACCESS ON
+#pragma STDC FENV_ACCESS ON
int e;
e = fetestexcept(FE_INEXACT);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Current pcc does not understand #pragma after whitespace
2012-11-28 6:37 Current pcc does not understand #pragma after whitespace Isaac Dunham
@ 2012-11-28 10:06 ` Szabolcs Nagy
2012-11-29 10:01 ` Iain Hibbert
0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2012-11-28 10:06 UTC (permalink / raw)
To: musl; +Cc: pcc-list
* Isaac Dunham <idunham@lavabit.com> [2012-11-27 22:37:58 -0800]:
> 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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Current pcc does not understand #pragma after whitespace
2012-11-28 10:06 ` Szabolcs Nagy
@ 2012-11-29 10:01 ` Iain Hibbert
0 siblings, 0 replies; 3+ messages in thread
From: Iain Hibbert @ 2012-11-29 10:01 UTC (permalink / raw)
To: Szabolcs Nagy; +Cc: musl, pcc-list
On Wed, 28 Nov 2012, Szabolcs Nagy wrote:
> * Isaac Dunham <idunham@lavabit.com> [2012-11-27 22:37:58 -0800]:
> > 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..
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-29 10:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-28 6:37 Current pcc does not understand #pragma after whitespace Isaac Dunham
2012-11-28 10:06 ` Szabolcs Nagy
2012-11-29 10:01 ` Iain Hibbert
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).