[PDNCF] Fix 'maybe-uninitialized' warning in GCC compiler
authorSeungSeop Park <sns.park@samsung.com>
Thu, 14 Jan 2016 04:29:25 +0000 (13:29 +0900)
committerYoungcheol Kang <ychul.kang@samsung.com>
Fri, 3 Jun 2016 08:25:13 +0000 (17:25 +0900)
Added GCC pragma to suppress the warning.

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=15562
Reviewed by: Antonio Gomes, Min-Soo Koo

Change-Id: I4f5cefc61df0ca7273ff8b0ce3caed1c0c15e4a2
Signed-off-by: SeungSeop Park <sns.park@samsung.com>
src/date.h

index 813e5b8..8a646cc 100644 (file)
@@ -152,6 +152,10 @@ 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
@@ -169,6 +173,9 @@ class DateCache {
     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,