From f069d5d9efe4336f455d28ae6008e8e0214a32af Mon Sep 17 00:00:00 2001 From: SeungSeop Park Date: Thu, 14 Jan 2016 13:29:25 +0900 Subject: [PATCH] [PDNCF] Fix 'maybe-uninitialized' warning in GCC compiler 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 --- src/date.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/date.h b/src/date.h index 813e5b83c..8a646cc6a 100644 --- a/src/date.h +++ b/src/date.h @@ -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(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, -- 2.34.1