From: SeungSeop Park Date: Thu, 21 Jan 2016 07:12:35 +0000 (+0900) Subject: fixup! [PDNCF] Fix 'maybe-uninitialized' warning in GCC compiler X-Git-Tag: submit/tizen_mobile/20160603.100254~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec24a2e10712a9d6b9b171624f507ef00c6fbd17;p=platform%2Fupstream%2Fv8.git fixup! [PDNCF] Fix 'maybe-uninitialized' warning in GCC compiler Following error in building content_shell with clang++ in desktop: > ../../v8/src/date.h:157:32: error: unknown warning group > '-Wmaybe-uninitialized', ignored [-Werror,-Wunknown-pragmas] Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=15496 Reviewed by: Antonio Gomes, mohan reddy Change-Id: Ibdb15c053532bb0daca5a60fd6e24731a14be755 Signed-off-by: SeungSeop Park --- diff --git a/src/date.h b/src/date.h index 8a646cc6a..33dde0c5e 100644 --- a/src/date.h +++ b/src/date.h @@ -152,10 +152,6 @@ class DateCache { } -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -#endif // Computes a time equivalent to the given time according // to ECMA 262 - 15.9.1.9. // The issue here is that some library calls don't work right for dates @@ -168,14 +164,11 @@ class DateCache { int64_t EquivalentTime(int64_t time_ms) { int days = DaysFromTime(time_ms); int time_within_day_ms = static_cast(time_ms - days * kMsPerDay); - int year, month, day; + int year=0, month=0, day=0; YearMonthDayFromDays(days, &year, &month, &day); int new_days = DaysFromYearMonth(EquivalentYear(year), month) + day - 1; return static_cast(new_days) * kMsPerDay + time_within_day_ms; } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // Returns an equivalent year in the range [2008-2035] matching // - leap year,