fixup! [PDNCF] Fix 'maybe-uninitialized' warning in GCC compiler
authorSeungSeop Park <sns.park@samsung.com>
Thu, 21 Jan 2016 07:12:35 +0000 (16:12 +0900)
committerYoungcheol Kang <ychul.kang@samsung.com>
Fri, 3 Jun 2016 08:25:13 +0000 (17:25 +0900)
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 <sns.park@samsung.com>
src/date.h

index 8a646cc6ad154be443cac5055e03dd3f33df60fc..33dde0c5ebf7bebf83e8f12b02fee2ad80e90137 100644 (file)
@@ -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<int>(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<int64_t>(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,