Skip to content

Format string warnings #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
user-none opened this issue Feb 26, 2012 · 1 comment
Closed

Format string warnings #11

user-none opened this issue Feb 26, 2012 · 1 comment

Comments

@user-none
Copy link
Contributor

When building the following format string warnings are generated.

localize.c: In function ‘prvTidyReportAccessWarning’:
localize.c:1376: warning: format not a string literal and no format arguments
localize.c: In function ‘prvTidyReportAccessError’:
localize.c:1383: warning: format not a string literal and no format arguments
localize.c: In function ‘prvTidyReportWarning’:
localize.c:1402: warning: format not a string literal and no format arguments
localize.c: In function ‘prvTidyReportError’:
localize.c:1483: warning: format not a string literal and no format arguments
localize.c:1502: warning: format not a string literal and no format arguments
localize.c: In function ‘prvTidyReportFatal’:
localize.c:1551: warning: format not a string literal and no format arguments

@user-none
Copy link
Contributor Author

diff -aur w3c-tidy-html5-f6a3bbe_orig/src/localize.c w3c-tidy-html5-f6a3bbe/src/localize.c
--- w3c-tidy-html5-f6a3bbe_orig/src/localize.c 2012-02-24 04:31:22.000000000 -0500
+++ w3c-tidy-html5-f6a3bbe/src/localize.c 2012-02-26 11:42:34.000000000 -0500
@@ -1373,14 +1373,14 @@
{
ctmbstr fmt = GetFormatFromCode(code);
doc->badAccess |= BA_WAI;

  • messageNode( doc, TidyAccess, node, fmt );
  • messageNode( doc, TidyAccess, node, "%s", fmt );
    }

void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code )
{
ctmbstr fmt = GetFormatFromCode(code);
doc->badAccess |= BA_WAI;

  • messageNode( doc, TidyAccess, node, fmt );
  • messageNode( doc, TidyAccess, node, "%s", fmt );
    }

#endif /* SUPPORT_ACCESSIBILITY_CHECKS */
@@ -1399,7 +1399,7 @@
switch (code)
{
case NESTED_QUOTATION:

  •    messageNode(doc, TidyWarning, rpt, fmt);
    
  •    messageNode(doc, TidyWarning, rpt, "%s", fmt);
     break;
    

    case OBSOLETE_ELEMENT:
    @@ -1480,7 +1480,7 @@
    case INCONSISTENT_NAMESPACE:
    case DOCTYPE_AFTER_TAGS:
    case DTYPE_NOT_UPPER_CASE:

  •    messageNode(doc, TidyWarning, rpt, fmt);
    
  •    messageNode(doc, TidyWarning, rpt, "%s", fmt);
     break;
    

    case COERCE_TO_ENDTAG:
    @@ -1499,7 +1499,7 @@
    case ENCODING_IO_CONFLICT:
    case MISSING_DOCTYPE:
    case SPACE_PRECEDING_XMLDECL:

  •    messageNode(doc, TidyWarning, node, fmt);
    
  •    messageNode(doc, TidyWarning, node, "%s", fmt);
     break;
    

    case TRIM_EMPTY_ELEMENT:
    @@ -1548,7 +1548,7 @@
    {
    case SUSPECTED_MISSING_QUOTE:
    case DUPLICATE_FRAMESET:

  •    messageNode(doc, TidyError, rpt, fmt);
    
  •    messageNode(doc, TidyError, rpt, "%s", fmt);
     break;
    

    case UNKNOWN_ELEMENT:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants