[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Broken commit e460f7dbb216
From: |
Detlef Riekenberg |
Subject: |
Re: [Tinycc-devel] Broken commit e460f7dbb216 |
Date: |
Thu, 4 Aug 2022 13:13:27 +0200 |
Hi grischka.
> Please try to be more precise.
> Also, the "(n > 1) &" part that you added in your one-line patch
>
> - if (n <= 0 || (n & (n - 1)) != 0)
> + if (n < 0 || ((n > 1) & ((n & (n - 1)) != 0)))
>
> is just redundant.
Yes, sorry for that.
I pushed a cleanup and check my patches better in the future
> As to the "n < 0 ||" clause by the way. the C-standards seem to say:
>
> "Alignments are represented as values of the type size_t. Valid alignments
> include only fundamental alignments, plus an additional implementation-
> defined set of values, which may be empty. Every valid alignment value
> shall be a nonnegative integral power of two."
>
> Well, when "size_t" means unsigned, how could it be not "nonnegative"
> then ?!?
we use an int while parsing, so an _Alignas(-1) in a source file
will arrive here.
Using "size_t" for is a bad decision, as it introduce more warnings for:
type_decl(&type1, &ad1, &n, TYPE_ABSTRACT);
and for
n = expr_const();
compared to a size_t for n and the casts for the warnings,
the current code with the "n < 0" is better.
I did not updated the failure message to hint, that zero is also
a valid option for _Alignas(), because there is also no hint in the gcc message
> As to your "My local workaround" below (-DTCC_LIBTCC1="\"libtcc1.a\"")
> all I can say is that it does not have any effect in the context of a
> tinycc as it is available in the public repo.
>
> Maybe you do have some local configuration hacks in place that may or
> may not have been disturbed.
You are allowed to follow my hint and try it yourself.
But please without your hack for windows, which reached the public repo:
echo>> ..\config.h #ifdef TCC_TARGET_X86_64
echo>> ..\config.h #define TCC_LIBTCC1 "libtcc1-64.a"
echo>> ..\config.h #else
echo>> ..\config.h #define TCC_LIBTCC1 "libtcc1-32.a"
echo>> ..\config.h #endif
Again, please fix the bug.
The failures from my previous message are still in the public repo.
And to verify with a windows target:
repo.or.cz_tinycc$ x86_64-win32-tcc helloworld.c -o
helloworld_x86_64-win32-tcc.exe
repo.or.cz_tinycc$ i386-win32-tcc helloworld.c -o helloworld_i386-win32-tcc.exe
repo.or.cz_tinycc$ ls -al helloworld*
-rw-rw-r-- 1 detlef detlef 108 Jun 10 21:38 helloworld.c
-rwxrwxr-x 1 detlef detlef 15960 Aug 4 11:57 helloworld_gcc
-rwxrwxrwx 1 detlef detlef 2048 Aug 4 11:56 helloworld_i386-win32-tcc.exe
-rwxrwxrwx 1 detlef detlef 3072 Aug 4 11:56 helloworld_x86_64-win32-tcc.exe
When using a Windows target, the includes in "win32/include" are used instead.
> > And your patch is incomplete.
> > The cross prefix for libtcc1 is missing with -print-search-dirs
that's also still present.
--
Bye bye ... Detlef