public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50645] New: old issue - deprecated conversion from string to char*
@ 2011-10-07  0:11 mike.c at rocketime dot com
  2011-10-07  0:35 ` [Bug c/50645] " mike.c at rocketime dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mike.c at rocketime dot com @ 2011-10-07  0:11 UTC (permalink / raw)
  To: gcc-bugs

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!)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-10-07  1:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-07  0:11 [Bug c/50645] New: old issue - deprecated conversion from string to char* mike.c at rocketime dot com
2011-10-07  0:35 ` [Bug c/50645] " mike.c at rocketime dot com
2011-10-07  0:38 ` pinskia at gcc dot gnu.org
2011-10-07  0:41 ` redi at gcc dot gnu.org
2011-10-07  0:44 ` redi at gcc dot gnu.org
2011-10-07  1:11 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).