Changeset 27947 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 21, 2007, 7:08:41 PM (18 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r27913 r27947 1 2007-11-20 Mark Rowe <[email protected]> 2 3 Reviewed by Tim Hatcher. 4 5 <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings 6 7 Fix all warnings emitted by GCC 4.2 when building JavaScriptCore. This allows builds with 8 -Werror to succeed. At present they will crash when executed due to code that is not safe 9 under strict aliasing (<rdar://problem/5536806>). 10 11 * Configurations/Base.xcconfig: Exclude the -Wno-long-double flag when building with GCC 4.2. 12 * kjs/date_object.cpp: 13 (KJS::formatTime): Test whether the stack-allocated string is empty rather than at a non-null address. 14 * kjs/dtoa.cpp: 15 (Bigint::): Tweak formatting to silence warnings. 16 * pcre/pcre_exec.cpp: 17 (match): Tweak formatting to silence warnings 18 * wtf/Assertions.cpp: Add printf format attribute to functions that warrant it. 19 * wtf/Assertions.h: Ditto. 20 1 21 2007-11-19 Kevin Ollivier <[email protected]> 2 22 -
trunk/JavaScriptCore/Configurations/Base.xcconfig
r27845 r27947 24 24 VALID_ARCHS = i386 ppc x86_64 ppc64; 25 25 WARNING_CFLAGS = $(WARNING_CFLAGS_$(CURRENT_ARCH)); 26 WARNING_CFLAGS_BASE = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -W no-long-double -Wundef;26 WARNING_CFLAGS_BASE = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wundef; 27 27 WARNING_CFLAGS_ = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32; 28 28 WARNING_CFLAGS_i386 = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32; -
trunk/JavaScriptCore/kjs/date_object.cpp
r27610 r27947 230 230 strftime(tzname, sizeof(tzname), "%Z", >m); 231 231 232 if (tzname ) {232 if (tzname[0]) { 233 233 snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d (%s)", 234 234 t.hour, t.minute, t.second, -
trunk/JavaScriptCore/kjs/dtoa.cpp
r23955 r27947 2975 2975 goto bump_up; 2976 2976 else if (dval(d) < 0.5 - dval(eps)) { 2977 while (*--s == '0');2977 while (*--s == '0') { } 2978 2978 s++; 2979 2979 goto ret1; … … 3294 3294 trimzeros: 3295 3295 #endif 3296 while (*--s == '0');3296 while (*--s == '0') { } 3297 3297 s++; 3298 3298 } -
trunk/JavaScriptCore/pcre/pcre_exec.cpp
r27847 r27947 1658 1658 (*stack.currentFrame->eptr < 128 && (md->ctypes[*stack.currentFrame->eptr] & ctype_space) != 0)) 1659 1659 RRETURN_NO_MATCH; 1660 while (++stack.currentFrame->eptr < md->end_subject && ISMIDCHAR(*stack.currentFrame->eptr)) ;1660 while (++stack.currentFrame->eptr < md->end_subject && ISMIDCHAR(*stack.currentFrame->eptr)) { } 1661 1661 } 1662 1662 break; … … 1676 1676 (*stack.currentFrame->eptr < 128 && (md->ctypes[*stack.currentFrame->eptr] & ctype_word) != 0)) 1677 1677 RRETURN_NO_MATCH; 1678 while (++stack.currentFrame->eptr < md->end_subject && ISMIDCHAR(*stack.currentFrame->eptr)) ;1678 while (++stack.currentFrame->eptr < md->end_subject && ISMIDCHAR(*stack.currentFrame->eptr)) { } 1679 1679 } 1680 1680 break; -
trunk/JavaScriptCore/wtf/Assertions.cpp
r26589 r27947 49 49 extern "C" { 50 50 51 // This is to work around the "you should use a printf format attribute" warning on GCC 52 // We can't use _attribute__ ((format (printf, 2, 3))) since we allow %@ 53 static int (* vfprintf_no_warning)(FILE *, const char*, va_list) = vfprintf; 54 51 WTF_ATTRIBUTE_PRINTF(1, 0) 55 52 static void vprintf_stderr_common(const char* format, va_list args) 56 53 { … … 92 89 } 93 90 #endif 94 vfprintf_no_warning(stderr, format, args);91 vfprintf(stderr, format, args); 95 92 } 96 93 94 WTF_ATTRIBUTE_PRINTF(1, 2) 97 95 static void printf_stderr_common(const char* format, ...) 98 96 { -
trunk/JavaScriptCore/wtf/Assertions.h
r26589 r27947 84 84 #endif 85 85 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 86 95 /* These helper functions are always declared, but not necessarily always defined if the corresponding function is disabled. */ 87 96 … … 99 108 100 109 void 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, ...) ;110 void WTFReportAssertionFailureWithMessage(const char* file, int line, const char* function, const char* assertion, const char* format, ...) WTF_ATTRIBUTE_PRINTF(5, 6); 102 111 void 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, ...) ;112 void WTFReportFatalError(const char* file, int line, const char* function, const char* format, ...) WTF_ATTRIBUTE_PRINTF(4, 5); 113 void WTFReportError(const char* file, int line, const char* function, const char* format, ...) WTF_ATTRIBUTE_PRINTF(4, 5); 114 void WTFLog(WTFLogChannel* channel, const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3); 115 void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel* channel, const char* format, ...) WTF_ATTRIBUTE_PRINTF(5, 6); 107 116 108 117 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.