Re: Vexing GCC warnings: "assignment discards qualifiers from pointer target type"
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 01/03/04
- Next message: CBFalconer: "Re: hash table"
- Previous message: Christopher Benson-Manica: "Re: print out a file?"
- In reply to: Peter Pichler: "Re: Vexing GCC warnings: "assignment discards qualifiers from pointer target type""
- Next in thread: Peter Pichler: "Re: Vexing GCC warnings: "assignment discards qualifiers from pointer target type""
- Reply: Peter Pichler: "Re: Vexing GCC warnings: "assignment discards qualifiers from pointer target type""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 02 Jan 2004 23:42:14 GMT
Peter Pichler wrote:
>
... snip ...
>
> Seriously, string literals in C have a type char[], not const
> char[] as one would expect when trying to modify them causes a UB.
> GCC probably realizes that and tries to prevent you from doing
> something stupid by warning about returning a string literal as
> char * without const.
He specifically told it to with -Wwrite-strings.
-- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
- Next message: CBFalconer: "Re: hash table"
- Previous message: Christopher Benson-Manica: "Re: print out a file?"
- In reply to: Peter Pichler: "Re: Vexing GCC warnings: "assignment discards qualifiers from pointer target type""
- Next in thread: Peter Pichler: "Re: Vexing GCC warnings: "assignment discards qualifiers from pointer target type""
- Reply: Peter Pichler: "Re: Vexing GCC warnings: "assignment discards qualifiers from pointer target type""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|