This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50645] New: old issue - deprecated conversion from string to char*
- From: "mike.c at rocketime dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 07 Oct 2011 00:11:14 +0000
- Subject: [Bug c/50645] New: old issue - deprecated conversion from string to char*
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50645
Bug #: 50645
Summary: old issue - deprecated conversion from string to char*
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mike.c@rocketime.com
While I know this is an old issue, I port a lot of code, so this keeps coming
up: (I know u can change the warning level).
If I declare:
const char *DowNames[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
NULL
};
as just char* instead of const char*, YES I WOULD LIKE TO GET A WARNING.
HOWEVER, if I have a function:
myfunction(char *buf) {}
I'd like to be able to call it like this
myfunction("hello world")
... WITH NO 'deprecated conversion from string to char*' WARNING
because char* as a parameter should be able to take a string as an argument --
this makes sense.
It's annoying to have to cast (char*)"hello world" every place in code, as
programmers always used to use, simply "hello world". (i know an option is to
change the warning level -- but that has other issues.)
PLEASE UNDEPRECATE! (Keep things simple, keep backward compatibility, as the
old-school way is often best, designed that way for simplicity!)