mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1203412 - Fix a warning in intl/unicharutil/. r=emk.
This change is for the following warning-as-error that shows up on "B2G L Emulator" builds: "error: call to 'sprintf' declared with attribute warning: sprintf is often misused; please use snprintf". The patch also removes two ALLOW_COMPILER_WARNINGS=True flags, which are no longer necessary.
This commit is contained in:
parent
dd73716c5d
commit
5f59618546
@ -10,6 +10,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsCharTraits.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "mozilla/Snprintf.h"
|
||||
|
||||
struct testcaseLine {
|
||||
wchar_t* c1;
|
||||
@ -136,7 +137,6 @@ bool TestUnspecifiedCodepoint(uint32_t codepoint)
|
||||
bool rv = true;
|
||||
char16_t unicharArray[3];
|
||||
nsAutoString X, normalized;
|
||||
char description[9];
|
||||
|
||||
if (IS_IN_BMP(codepoint)) {
|
||||
unicharArray[0] = codepoint;
|
||||
@ -157,8 +157,11 @@ bool TestUnspecifiedCodepoint(uint32_t codepoint)
|
||||
|
||||
X == NFC(X) == NFD(X) == NFKC(X) == NFKD(X)
|
||||
*/
|
||||
static const size_t len = 9;
|
||||
char description[len];
|
||||
|
||||
DEBUG_TESTCASE(X);
|
||||
sprintf(description, "U+%04X", codepoint);
|
||||
snprintf(description, len, "U+%04X", codepoint);
|
||||
NORMALIZE_AND_COMPARE(X, X, NFC, description);
|
||||
NORMALIZE_AND_COMPARE(X, X, NFD, description);
|
||||
NORMALIZE_AND_COMPARE(X, X, NFKC, description);
|
||||
|
@ -8,7 +8,4 @@ SOURCES += [
|
||||
'NormalizationTest.cpp',
|
||||
]
|
||||
|
||||
# XXX: We should fix these warnings.
|
||||
ALLOW_COMPILER_WARNINGS = True
|
||||
|
||||
FINAL_LIBRARY = 'xul-gtest'
|
||||
|
@ -43,7 +43,4 @@ if CONFIG['ENABLE_INTL_API']:
|
||||
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
|
||||
USE_LIBS += ['icu']
|
||||
|
||||
if not CONFIG['GNU_CXX']:
|
||||
ALLOW_COMPILER_WARNINGS = True
|
||||
|
||||
DIST_INSTALL = True
|
||||
|
Loading…
Reference in New Issue
Block a user