https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123768

            Bug ID: 123768
           Summary: string literal warning not useful for strftime
           Product: gcc
           Version: 13.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mgrant at grant dot org
  Target Milestone: ---

Compiling lines like this with -Wformat=2 or -Wformat-nonliteral:

    strftime(s, sizeof s, time_format, &tm);

causes this warning:

warning: format not a string literal, format string not checked
[-Wformat-nonliteral]

This warning is useful for printf/sprintf but not useful for strftime which
does not depend on its time_format to have matching % params in the arg list.

Reply via email to