On 14.12.2024 20:08, sleeptightAnsiC wrote:
Hello,

TCC predefines almost all ORDER macros
which GCC and Clang also defines,
but not __ORDER_PDP_ENDIAN__ nor __FLOAT_WORD_ORDER__

$ gcc -E -dM - < /dev/null | grep 'ORDER'
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __ORDER_PDP_ENDIAN__ 3412
#define __ORDER_BIG_ENDIAN__ 4321
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
$ tcc -E -dM - < /dev/null | grep 'ORDER'
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_BIG_ENDIAN__ 4321
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
$ tcc --version
tcc version 0.9.28rc 2024-12-13 mob@8620a312* (x86_64 Linux)

I'm not sure about __FLOAT_WORD_ORDER__
but I guess __ORDER_PDP_ENDIAN__ can be added right away like so:

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

For example you can do a research on __ORDER_BIG_ENDIAN__in the
tinycc commits and will find that is was first added in

https://repo.or.cz/tinycc.git/commitdiff/9712aff9c00ecf24adc89f42aa674ede4e35137d
libtcc.c:
- 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)".

-- gr

diff --git a/include/tccdefs.h b/include/tccdefs.h
index 3ad83d12..0e6df873 100644
--- a/include/tccdefs.h
+++ b/include/tccdefs.h
@@ -55,6 +55,7 @@
      #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
      #define __CHAR_BIT__ 8
      #define __ORDER_LITTLE_ENDIAN__ 1234
+    #define __ORDER_PDP_ENDIAN__ 3412
      #define __ORDER_BIG_ENDIAN__ 4321
      #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
  #if defined _WIN32

Is this OK?


Best Regards,
Kornel


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



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

Reply via email to