Need NSPR_PRINTF_FORMAT macro to warn mistakes in printf format

RESOLVED DUPLICATE of bug 277394

Status

NSPR
NSPR
RESOLVED DUPLICATE of bug 277394
7 years ago
6 years ago

People

(Reporter: hiro, Assigned: hiro)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
Created attachment 550573 [details] [diff] [review]
Proposed patch

Like cairo does.

http://mxr.mozilla.org/mozilla-central/source/gfx/cairo/cairo/src/cairo-compiler-private.h#109

108 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
109 #define CAIRO_PRINTF_FORMAT(fmt_index, va_index) \
110 	__attribute__((__format__(__printf__, fmt_index, va_index)))
(Assignee)

Updated

7 years ago
Attachment #550573 - Flags: review?(wtc)
(Assignee)

Comment 1

7 years ago
Created attachment 550618 [details] [diff] [review]
Correct position

Apparently NSPR_[PRINTF|SCANF]_FORMAT were in a wrong ifdef block.
Assignee: wtc → hiikezoe
Attachment #550573 - Attachment is obsolete: true
Attachment #550573 - Flags: review?(wtc)
Attachment #550618 - Flags: review?(wtc)

Comment 2

6 years ago
hiro: thank you for the suggestion and the patch.

Unfortunately we can't do this because NSPR uses
the %ld and %hd integer formats in a nonstandard
way.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 277394

Updated

6 years ago
Attachment #550618 - Flags: review?(wtc) → review-
You need to log in before you can comment on or make changes to this bug.