[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] spurious warning from tcc
From: |
Edmund Grimley Evans |
Subject: |
Re: [Tinycc-devel] spurious warning from tcc |
Date: |
Sun, 3 Jan 2016 22:48:43 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Aharon Robbins <address@hidden>:
> TCC doesn't quite understand where const should and should not go. I'm
> getting this warning:
>
> dfa.c:1795: warning: assignment discards qualifiers from pointer target type
Yes, there is a failure to follow this part of the C standard:
"If the specification of an array type includes any type qualifiers,
the element type is so-qualified, not the array type."
So things like this don't work:
typedef int A[1];
extern A const x;
extern const A x;
Both declarations of x should be equivalent to:
extern const int x[1];
On 2015-11-19 I committed a patch to handle some cases of this. Here's
a patch that might finish the job. Any comments, before I commit it?
Edmund
patch
Description: Text document