Hello Patrick,
Thank you for the report.
I investigated it and confirmed that this was caused by a bug in TinyCC:
qualifiers from a const or volatile aggregate were not propagated correctly
for array members.
I have fixed the issue and pushed the fix to mob:
a338258d Fix qualifiers on const array struct members
Your original test case now compiles without warning. I also added regression
tests for const and volatile array member cases.
Regards,
Mounir IDRASSI
From: Patrick Pelissier <[email protected]>
To: <[email protected]>
Date: Sat, 13 Jun 2026 18:27:51 +0900
Subject: [Tinycc-devel] Unexpected warning assignment discards qualifiers from
pointer target type
> Hello,
>
> for the following program,
>
> typedef int int_array[1];
>
> typedef struct {
> int_array arr;
> } my_struct;
>
> int_array const * get_array(const my_struct *s) {
> return &(s->arr);
> }
>
> when compiling with tcc, I got the following warning:
>
> t.c:8: warning: assignment discards qualifiers from pointer target type
>
> whereas I didn't expect any warning (and didn't get any with GCC and
> CLANG with -W -Wall -Wextra)
>
> --
> Regards,
> Patrick Pélissier
>
> _______________________________________________
> Tinycc-devel mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel