Jared, The file is in win32/include/math.h It contains two times the exact same inline definition which is obviously an error for any C compiler.
To me, all code from line 734 to 778 is duplicated from line 669 and should be removed. This file, as copyright notice says, is part of the w64 mingw-runtime package. However, math.h from 4.8.0 w64 mingw-runtime is similar but bigger (1056 lines V.S. 782). If it also contains the same __fp_unordered_compare inline definition, at least this one is defined only once. I suspect math.h from tcc is a very old copy of (buggy?) mingw and only recently tcc protests when the same inline definition is seen twice, which is the correct C behavior. Easy fix: remove the second definition from current math.h in tcc. Little bit harder (because it requires tests on all tcc supported platforms), use newer version from mingw (and maybe also other *.h stolen from this nice project). The general question behind this bug is how tcc maintains *.h for Windows? I vote for sharing those files with mingw. M2c Christian -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jared Maddox Sent: dimanche 8 décembre 2013 04:16 To: [email protected] Subject: Re: [Tinycc-devel] __fp_unordered_compare defined twice on Windows > Date: Sat, 7 Dec 2013 16:48:17 +0000 (GMT) > From: Rob <[email protected]> > To: [email protected] > Subject: Re: [Tinycc-devel] __fp_unordered_compare defined twice on > Windows > Message-ID: <alpine.DEB.2.02.1312071643200.25263@egbert> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > 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 > Couldn't see the file (might be a Javascript filter on my end), but were there two definitions of the function in the preprocessed source? That bit of the standard reads to me as if it doesn't explicitly allow two definitions in the same preprocessed source, just in the finished executable. By the looks of it, it's aimed at allowing headers to have a preprocessor switch that chooses between inlines and prototypes, so that could be the catch. _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
