This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33588] New: gcc warns of (char*) conversion on client-side varargs funcs


(i submitted this via gccbugs, but the script gave me no feedback about whether
the report was actually sent or not, so i'm re-posting here.)

gcc 4.2.1 appears to incorrectly(?) give a warning when a client-written
varargs func is passed a string literal (e.g. __FILE__) as one of the
arguments. e.g.

my_func( "format string: %s", __FILE__ )

warning: deprecated conversion from string constant to ?char'

Curiously, the warning is not emitted when printf() is used.

This apparently bogus warning causes -Werror builds (that is, all of my builds)
to fail.

i will attach a demo file after saving this bug (assuming bugzilla lets me,
otherwise i'll paste it in as a comment).


-- 
           Summary: gcc warns of (char*) conversion on client-side varargs
                    funcs
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stephan at s11n dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33588


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]