Fix GCC complaints about uninitialized variables (bug #3912).
authorDmitry Gorbachev <gorbachev@reactos.org>
Wed, 3 Dec 2008 17:38:56 +0000 (17:38 +0000)
committerDmitry Gorbachev <gorbachev@reactos.org>
Wed, 3 Dec 2008 17:38:56 +0000 (17:38 +0000)
svn path=/trunk/; revision=37834

reactos/lib/rtl/bitmap.c
reactos/lib/sdk/crt/time/ctime.c
reactos/ntoskrnl/config/ntapi.c
reactos/ntoskrnl/ke/bug.c

index e221177..3601580 100644 (file)
@@ -651,7 +651,8 @@ ULONG NTAPI
 RtlFindLongestRunClear(PRTL_BITMAP BitMapHeader,
                       PULONG StartingIndex)
 {
-  RTL_BITMAP_RUN br;
+  /* GCC complaints that it may be used uninitialized */
+  RTL_BITMAP_RUN br = { 0, 0 };
 
   if (RtlFindClearRuns(BitMapHeader, &br, 1, TRUE) == 1)
   {
@@ -670,7 +671,8 @@ ULONG NTAPI
 RtlFindLongestRunSet(PRTL_BITMAP BitMapHeader,
                     PULONG StartingIndex)
 {
-  RTL_BITMAP_RUN br;
+  /* GCC complaints that it may be used uninitialized */
+  RTL_BITMAP_RUN br = { 0, 0 };
 
   if (NTDLL_FindRuns(BitMapHeader, &br, 1, TRUE, NTDLL_FindSetRun) == 1)
   {
index 822003b..4781eb0 100644 (file)
@@ -1276,7 +1276,9 @@ time2(struct tm *tmp, void (*const funcp)(const time_t * CPP_CONST, const long,
   int saved_seconds;
   time_t newt;
   time_t t;
-  struct tm yourtm, mytm;
+
+  /* GCC complaints that it may be used uninitialized */
+  struct tm yourtm, mytm = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
   *okayp = FALSE;
   yourtm = *tmp;
index 860d441..d272a27 100644 (file)
@@ -612,7 +612,11 @@ NtDeleteValueKey(IN HANDLE KeyHandle,
     REG_DELETE_VALUE_KEY_INFORMATION DeleteValueKeyInfo;
     REG_POST_OPERATION_INFORMATION PostOperationInfo;
     KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
-    UNICODE_STRING ValueNameCopy = *ValueName;
+
+    /* Workaround for GCC 4.4.0 bug #38271 */
+    UNICODE_STRING ValueNameCopy = { 0, 0, NULL };
+    ValueNameCopy = *ValueName;
+
     PAGED_CODE();
 
     /* Verify that the handle is valid and is a registry key */
index b537ba0..98f25b0 100644 (file)
@@ -236,7 +236,9 @@ KeRosDumpStackFrameArray(IN PULONG Frames,
     ULONG i, Addr;
     BOOLEAN InSystem;
     PVOID p;
-    PLDR_DATA_TABLE_ENTRY LdrEntry;
+
+    /* GCC complaints that it may be used uninitialized */
+    PLDR_DATA_TABLE_ENTRY LdrEntry = NULL;
 
     /* Loop them */
     for (i = 0; i < FrameCount; i++)