[Top][All Lists]

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

Re: [Tinycc-devel] LOTS of warnings when using function pointers.

From: Ben
Subject: Re: [Tinycc-devel] LOTS of warnings when using function pointers.
Date: Mon, 08 Jul 2013 22:07:28 +0100

On Mon, 2013-07-08 at 16:02 -0300, Mario Rugiero wrote:
> But the header is protected.

You mean the "include guards" (#ifndef __COM_MATH_H__etc)?  Those
prevent repeated inclusion in any one translation unit.  They don't stop
(for example) x.c and y.c both including env/com_math.h.  I don't know
CMake and its errors so I don't know exactly what the error you are
getting means, but it looks very much like linker error to me.

Having the same name defined twice in two translation units is undefined
behaviour (i.e. the C standard does not say anything at all about what
such a program means) so compilers can do pretty much what they like.
gcc takes a very liberal view and, IIRC, simply overlaps the two
definitions (effectively giving them the same address).

If tcc behaves differently, it is entitled to and the proper solution is
to remove the multiple definitions (always assuming that the problem is
indeed a multiple definition of pfSqrt).

Q: is top-posting the norm here?  I've bottom-posted my reply but that
might just be making things worse if top-posting is usual.

reply via email to

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