tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] _Generic or __builtin_choose_expr


From: Christian Jullien
Subject: Re: [Tinycc-devel] _Generic or __builtin_choose_expr
Date: Fri, 14 Jul 2017 07:22:37 +0200

It's nice to see new features coming on tcc, but it's also nice if they work
everywhere
_Generic author(s) can you please take time to fix failing test?

Test: 94_generic...
--- ../../tests/tests2/94_generic.expect        2017-07-10
23:00:46.045513740 +0200
+++ 94_generic.output   2017-07-14 07:12:25.965274077 +0200
@@ -1,9 +1 @@
-20
-20
-123
-2
-5
-1
-2
-3
-1
+94_generic.c:44: error: type march twice

IMHO, your test depends on how different types are implemented in native
machine. So it's more a test issue than an implementation issue.
May be? Using 'portable' types like uint32_t may solve some issues. You may
also solve const/non const issue signed/unsigned char by forcing an exact
type OR by giving the same value whether string is const or not.

In any cases, 94_generic should produce NO error on platform tcc supports.
I'll be on vacation next two weeks and have limited time to investigate
myself but I'll be glad to test changes on Windows 32/64 and RPi

Christian

-----Original Message-----
From: Tinycc-devel [mailto:address@hidden
On Behalf Of grischka
Sent: dimanche 9 juillet 2017 12:48
To: address@hidden
Subject: Re: [Tinycc-devel] _Generic or __builtin_choose_expr

grischka wrote:
> uso ewin wrote:
>> I'm sorry but I don't have any arm machine, does someone have an idea 
>> how to fix, or debug this ?
> 
> ARM defines CHAR_IS_UNSIGNED which sets
>     tcc_state->char_is_unsigned.

Fixed in http://repo.or.cz/tinycc.git/commitdiff/9f79b62e here:

     @@ -4381,6 +4385,8 @@ ST_FUNC void unary(void)
          case TOK_STR:
              /* string parsing */
              t = VT_BYTE;
     +        if (tcc_state->char_is_unsigned)
     +            t = VT_BYTE | VT_UNSIGNED;
          str_init:
              if (tcc_state->warn_write_strings)
                  t |= VT_CONSTANT;
-- gr


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




reply via email to

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