tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Warning/bug detected by clang


From: avih
Subject: Re: [Tinycc-devel] Warning/bug detected by clang
Date: Thu, 21 Nov 2024 13:59:10 +0000 (UTC)

I can't speak for the maintainers of tcc (which I'm not), but I agree with the 
current state that adding the compiler flag is enough, and if more compilers 
need it, then it would be very simple to change "configure" to support it, e.g. 
replace:

if test "$cc_name" = "clang"; then
...
fi

with:

case $cc_name in clang | foo | bar)
...
esac

Personally I don't think it's unclear code, and I wouldn't modify the code only 
to suppress this warning, because I think this warning is going too far with 
trying coerce the developers to change their coding style to what clang think 
is the best.

Again, that's only my personal opinion, and I don't speak for the maintainers 
of tcc, so no point in trying to convince me that other options are better.

It's also clearly subjective, and there's no real right or wrong here. Well, 
the code is not wrong, on that we can agree. Beyond that, it's a matter of 
opinions which IMO is not really worth aguing about.

The maintainers of tcc read the mailing list and this thread, and if they think 
that changing the code is better, then they will do it.

Cheers,
avih






On Thursday, November 21, 2024 at 03:39:45 PM GMT+2, Domingo Alvarez Duarte 
<mingodad@gmail.com> wrote: 





Thanks fo reply !

Again even if it's valid C code it's clear that it has several drawbacks 
pointed so far by other comments on this thread and if there is a more 
clean/clear/elegant way to express it why not talk/try it out ?

Cheers !

On 21/11/24 14:36, avih via Tinycc-devel wrote:
> Fow what it's worth, when compiling with clang, the "configure" script adds 
> to the compiler flag:
>
> -Wno-string-plus-int
>
> exactly to suppress this warning, because it's stupid, and it's valid C code, 
> and the developers of tcc know that string + int is adding to the pointer and 
> not to the number inside that string.
>
> So maybe whatever compiler which produces this warning can add support for 
> this flag, and tcc configure can be updated to use this flag with this 
> compiler as well (in addition to clang).
>
>
>
> On Thursday, November 21, 2024 at 12:05:20 PM GMT+2, ian <menearly@gmail.com> 
> wrote:
>
>
>
>
>
>
> Hi
>
>
> #define TCC_VERSION_MAJOR "0.9."🤣
>
> 0 is the major version, 9 is a subversion, 28 is the minor version.
> If you wanna have clear code :
>
> #define TCC_VERSION_MAJOR "0"#define TCC_VERSION_SUB ".9"#define 
> TCC_VERSION_MINOR ".28"#define TCC_RELEASE_CANDIDATE "rc"#define TCC_VERSION 
> TCC_VERSION_MAJOR TCC_VERSION_SUB TCC_VERSION_MINOR TCC_RELEASE_CANDIDATE
>
> is better ...
>
> And as I said earlier :
>
> Maybe should « "zig cc" (clang 18) » preprocessor handle in a smarter way 
> things like DEFINED_STUFF + CONST_VALUE ?
>
>
>
>
> Regards,
>
> ian
>
>
> Le 21/11/2024 à 10:25, Domingo Alvarez Duarte a écrit :
>
>
>
>> #define TCC_VERSION_MAJOR "0.9."

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


reply via email to

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