Ignore:
Timestamp:
Nov 21, 2007, 7:08:41 PM (18 years ago)
Author:
[email protected]
Message:

Fix <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings.

Reviewed by Tim Hatcher.

Fix all warnings emitted by GCC 4.2 when building JavaScriptCore. This allows builds with
-Werror to succeed. At present they will crash when executed due to code that is not safe
under strict aliasing (<rdar://problem/5536806>).

This required some format strings to be modified in WebCore and WebKit as their format
specifiers did not match the argument type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Assertions.h

    r26589 r27947  
    8484#endif
    8585
     86// WTF logging functions can process %@ in the format string to log a NSObject* but the printf format attribute
     87// emits a warning when %@ is used in the format string.  Until <rdar://problem/5195437> is resolved we can't include
     88// the attribute when being used from Objective-C code in case it decides to use %@.
     89#if COMPILER(GCC) && !defined(__OBJC__)
     90#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(printf, formatStringArgument, extraArguments)))
     91#else
     92#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments)
     93#endif
     94
    8695/* These helper functions are always declared, but not necessarily always defined if the corresponding function is disabled. */
    8796
     
    99108
    100109void WTFReportAssertionFailure(const char* file, int line, const char* function, const char* assertion);
    101 void WTFReportAssertionFailureWithMessage(const char* file, int line, const char* function, const char* assertion, const char* format, ...);
     110void WTFReportAssertionFailureWithMessage(const char* file, int line, const char* function, const char* assertion, const char* format, ...) WTF_ATTRIBUTE_PRINTF(5, 6);
    102111void WTFReportArgumentAssertionFailure(const char* file, int line, const char* function, const char* argName, const char* assertion);
    103 void WTFReportFatalError(const char* file, int line, const char* function, const char* format, ...) ;
    104 void WTFReportError(const char* file, int line, const char* function, const char* format, ...);
    105 void WTFLog(WTFLogChannel* channel, const char* format, ...);
    106 void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel* channel, const char* format, ...);
     112void WTFReportFatalError(const char* file, int line, const char* function, const char* format, ...) WTF_ATTRIBUTE_PRINTF(4, 5);
     113void WTFReportError(const char* file, int line, const char* function, const char* format, ...) WTF_ATTRIBUTE_PRINTF(4, 5);
     114void WTFLog(WTFLogChannel* channel, const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3);
     115void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel* channel, const char* format, ...) WTF_ATTRIBUTE_PRINTF(5, 6);
    107116
    108117#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.