https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Andrew Pinski changed:
What|Removed |Added
Status|REOPENED|NEW
Summary|Misleading warnin
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Andrew Pinski changed:
What|Removed |Added
CC||ideasman42 at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Eric Gallager changed:
What|Removed |Added
Keywords||diagnostic, documentation
--- Comment #1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
--- Comment #17 from Keith Thompson ---
I just took a quick look at the discussion on the gcc-patches mailing
list.
It's true that the standard doesn't classify plain "char" either as a
signed integer type or as an unsigned integer type.
But I
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
--- Comment #16 from joseph at codesourcery dot com ---
Well, an additional
note: 'char' and 'signed char' are different types
(or similar in the unsigned case) could be added in the case where the
types have the same representation, one is ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Bernd Schmidt changed:
What|Removed |Added
CC||bernds at gcc dot gnu.org,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Marek Polacek changed:
What|Removed |Added
CC||mpolacek at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Keith Thompson changed:
What|Removed |Added
Version|4.0.0 |5.3.0
--- Comment #13 from Keith Thomps
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
Jackie Rosen changed:
What|Removed |Added
CC||jackie.rosen at hushmail dot
com
--- Comm
--- Comment #11 from manu at gcc dot gnu dot org 2008-03-31 11:03 ---
Actually as a user I would find clearer a warning such:
warning: initialization of 'signed char *' from incompatible pointer type 'char
*'
so CONFIRMED.
--
manu at gcc dot gnu dot org changed:
What
--- Comment #10 from kst at mib dot org 2008-03-30 21:49 ---
(In reply to comment #9)
> >I'd expect the warning to be muted in one of the calls, depending on
> -f{un}signed-char.
>
> No, char is a seperate type from signed char and unsigned char so they are
> always incompatiable when it
--- Comment #9 from pinskia at gcc dot gnu dot org 2008-03-30 20:42 ---
>I'd expect the warning to be muted in one of the calls, depending on
-f{un}signed-char.
No, char is a seperate type from signed char and unsigned char so they are
always incompatiable when it comes to pointers to t
--- Comment #8 from axel at zankasoftware dot com 2006-01-16 17:14 ---
There's also the following issue, which seem related.
$ cat test.c
void nil_uch(unsigned char *uch) {
*uch = 0;
}
void nil_sch(signed char *sch) {
*sch = 0;
}
int main(void) {
char ch = 0;
nil_uch(
--- Comment #7 from ebotcazou at gcc dot gnu dot org 2005-10-09 17:47
---
But it's platform-independent.
--
ebotcazou at gcc dot gnu dot org changed:
What|Removed |Added
--
What|Removed |Added
CC||christian dot joensson at
||gmail dot com
http://gcc.gnu.org/bu
--- Additional Comments From kst at mib dot org 2005-07-27 19:34 ---
I misused the term "compatible" above (and I think the standard itself
is sometimes a bit loose about the term).
All references are to the C99 standard. I think the C90 rules are the
same or very similar.
6.7.8p11:
--- Additional Comments From schlie at comcast dot net 2005-07-27 16:22
---
(In reply to comment #4)
> Oh, I agree completely that making string literals const
> (as they are in C++) would make more sense. The reason they
> aren't defined that way in C is that by the time "const" was
>
--- Additional Comments From kst at mib dot org 2005-07-27 01:54 ---
Oh, I agree completely that making string literals const
(as they are in C++) would make more sense. The reason they
aren't defined that way in C is that by the time "const" was
added to the language, there was too much
--- Additional Comments From schlie at comcast dot net 2005-07-26 23:58
---
(In reply to comment #2)
> String literals in C are char*, not const char*, though writing to a
> string literal invokes undefined behavior. But that's not the point.
Actually as string literals are defined as
--- Additional Comments From kst at mib dot org 2005-07-26 21:07 ---
String literals in C are char*, not const char*, though writing to a
string literal invokes undefined behavior. But that's not the point.
Assuming plain char is signed, the warning
"pointer targets in initializatio
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-26
20:03 ---
I don't think the warning is misleading as strings are only ever "const char*"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087
22 matches
Mail list logo