So it looks like the bad commit is
76cb1144ef91924c53c57ea71e6f67ce73ce1cc6. I can't remember but they're
inline functions, and I think the standard allows two definitions - an
inline one and an extern one.
I've attached a quick fix that modifies the header, but I suspect the
proper fix is the function inline redefinition logic in tcc.
"An inline definition does not provide an external definition for the
function, and does not forbid an external definition in another
translation unit. An inline definition provides an alternative to an
external definition, which a translator may use to implement any call to
the function in the same translation unit. It is unspecified whether a
call to the function uses the inline definition or the external
definition." - C99, 6.7.4
Rob
On Sat, 7 Dec 2013, Christian Jullien wrote:
Sorry if doubled-posted but previous replied (with attachment) has not been
distributed.
-----Original Message-----
From: Christian Jullien [mailto:[email protected]]
Sent: samedi 7 décembre 2013 12:26
To: '[email protected]'
Subject: RE: [Tinycc-devel] __fp_unordered_compare defined twice on Windows
Hi Rob,
This is the win32/includes/math.h from mod you can watch on
http://repo.or.cz/w/tinycc.git/blob/3676f61983ca65506186c5429fc85a8da6642f3e
:/win32/include/math.h
It seems this file has not been modified for several years.
I don't know why this issue appears only now?
Christian
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rob
Sent: samedi 7 décembre 2013 11:59
To: [email protected]
Subject: Re: [Tinycc-devel] __fp_unordered_compare defined twice on Windows
On Sat, 7 Dec 2013, Christian Jullien wrote:
Hi x86/x64 Windows maintainers,
This morning, I chekouted the latest TCC version from mod to update tcc on
Windows (both x86/x64).
It used to work flawlessly (my latest successful build was made on
October).
Using gcc, I now get an error because __fp_unordered_compare (long
double x, long double y) is defined twice in math.h
First time at line 690 __fp_unordered_compare (long double x, long
double y){ Second time at line 754 __fp_unordered_compare (long double
x, long double y){
In file included from bignum.c:13:
In file included from openlisp.h:23:
In file included from defs.h:219:
f:/tinycc/win32/include/math.h:754: error: redefinition of
'__fp_unordered_compare'
NMAKE : fatal error U1077: 'f:\tinycc\win32\tcc.EXE' : return code '0x1'
Can you attached the preprocessed source? I don't have Windows headers.
Sounds like it might be an inline vs static inline definition problem.
Thanks,
Rob
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
diff --git i/win32/include/math.h w/win32/include/math.h
index 984a717..5f21cd0 100644
--- i/win32/include/math.h
+++ w/win32/include/math.h
@@ -693,6 +693,7 @@ extern "C" {
"fnstsw;": "=a" (retval) : "t" (x), "u" (y));
return retval;
}
+#define __fp_unordered_compare_DEFINED 1
#define isgreater(x, y) ((__fp_unordered_compare(x, y) \
& 0x4500) == 0)
@@ -749,6 +750,8 @@ extern "C++" {
#define isunordered(x, y) __builtin_isunordered(x, y)
#else
+
+#ifndef __fp_unordered_compare_DEFINED
/* helper */
__CRT_INLINE int __cdecl
__fp_unordered_compare (long double x, long double y){
@@ -757,6 +760,7 @@ __fp_unordered_compare (long double x, long double y){
"fnstsw;": "=a" (retval) : "t" (x), "u" (y));
return retval;
}
+#endif
#define isgreater(x, y) ((__fp_unordered_compare(x, y) \
& 0x4500) == 0)
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel