tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Annoying new warning


From: Christian Jullien
Subject: Re: [Tinycc-devel] Annoying new warning
Date: Sat, 6 May 2017 06:50:12 +0200

Hi Grischka,

Using your advice, I added #if !defined(TCC_TARGET_ARM) around all code
directly or indirectly using ldouble_long which solved warning.
If you agree, I'll push this change on mod but IMHO it should be done the
other way, #if defined(<targets-that-need-it>)

address@hidden:~/tinycc $ git diff
diff --git a/lib/libtcc1.c b/lib/libtcc1.c
index 9195489..9353d9a 100644
--- a/lib/libtcc1.c
+++ b/lib/libtcc1.c
@@ -76,6 +76,7 @@ typedef long double XFtype;
 #define EXPLD(fp)      (fp.l.upper & 0x7fff)
 #define SIGNLD(fp)     ((fp.l.upper) & 0x8000)

+#if !defined(TCC_TARGET_ARM)
 /* only for x86 */
 union ldouble_long {
     long double ld;
@@ -84,6 +85,7 @@ union ldouble_long {
         unsigned short upper;
     } l;
 };
+#endif

 union double_long {
     double d;
@@ -550,6 +552,7 @@ unsigned long long __fixunssfdi (float a1)
         return 0;
 }

+#if !defined(TCC_TARGET_ARM)
 unsigned long long __fixunsdfdi (double a1)
 {
     register union double_long dl1;
@@ -598,24 +601,25 @@ unsigned long long __fixunsxfdi (long double a1)
         return 0;
 }

-long long __fixsfdi (float a1)
+long long __fixdfdi (double a1)
 {
     long long ret; int s;
-    ret = __fixunssfdi((s = a1 >= 0) ? a1 : -a1);
+    ret = __fixunsdfdi((s = a1 >= 0) ? a1 : -a1);
     return s ? ret : -ret;
 }

-long long __fixdfdi (double a1)
+long long __fixxfdi (long double a1)
 {
     long long ret; int s;
-    ret = __fixunsdfdi((s = a1 >= 0) ? a1 : -a1);
+    ret = __fixunsxfdi((s = a1 >= 0) ? a1 : -a1);
     return s ? ret : -ret;
 }
+#endif

-long long __fixxfdi (long double a1)
+long long __fixsfdi (float a1)
 {
     long long ret; int s;
-    ret = __fixunsxfdi((s = a1 >= 0) ? a1 : -a1);
+    ret = __fixunssfdi((s = a1 >= 0) ? a1 : -a1);
     return s ? ret : -ret;
 }

-----Original Message-----
From: Tinycc-devel [mailto:address@hidden
On Behalf Of grischka
Sent: vendredi 5 mai 2017 15:05
To: address@hidden
Subject: Re: [Tinycc-devel] Annoying new warning

Christian JULLIEN wrote:
> Grischka,
> 
> it was my first attempt with fprintf+exit(0) but I found that none was
available in libtcc.
> 
> I vote for _xxx_abort(const char* msg);
> 
> Christian

Nope.  Just #ifdef out the entire function.

--- grischka


_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]