tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] patch: add __ORDER_PDP_ENDIAN__ for compatibility wit


From: sleeptightAnsiC
Subject: Re: [Tinycc-devel] patch: add __ORDER_PDP_ENDIAN__ for compatibility with GCC and Clang
Date: Wed, 18 Dec 2024 01:46:49 +0100

Many things do exist in GCC, and many of them could be easily
> added to TCC, but for what reason in practice?

This would be just for consistency really.

GCC manual mentions 4 macros for determining Endianess:
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#__BYTE_ORDER__
So this is a bit strange that TCC supports 3 out of 4
since adding __ORDER_PDP_ENDIAN__ won't change anything
other than preventing issues in situations like this:
    #if __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__

> - Add some defines for gcc testsuite (only most common)
>
> According to that the author found that the ability to run the
> gcc testsuite has some practical relevance because it can help
> to improve tinycc, and he also made a decision what to add and
> what not "(only most common)".

Yup, that's about right.
GCC testsuite rarely uses __ORDER_PDP_ENDIAN__ compared to others.
Only 3 lines using it compared to 103 and 93, though it's still here: $ \
        clone https://github.com/gcc-mirror/gcc.git --depth 1 2> /dev/null \
        && rg __ORDER_BIG_ENDIAN__ gcc/gcc/testsuite | grep __ORDER_BIG_ENDIAN__ | wc -l \
        && rg __ORDER_LITTLE_ENDIAN__ gcc/gcc/testsuite | grep __ORDER_LITTLE_ENDIAN__ |  wc -l \
        && rg __ORDER_PDP_ENDIAN__ gcc/gcc/testsuite | grep __ORDER_PDP_ENDIAN__ | wc -l \
;
103
93
3
Well, I'm not pushing on this patch.
I found a case in my code where I have to define it manually just for TCC
and fought it would be nice if it can be predefined just like other compilers do.

BTW, Much thanks for your reply.
I've send two other messages to this mailing list and they went silent without any response.
I was starting to worry that I'm doing something wrong.

Kind Regards,
Kornel

reply via email to

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