linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix GCC4 compile warnings
@ 2005-01-16 18:09 Tobias Klauser
  2005-01-16 18:31 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tobias Klauser @ 2005-01-16 18:09 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

Hi

I tried to compile udev 050plus with the GCC 4.0 snapshot 200412119 and 
got two errors about possibly uninitialized structs, so I fixed this. 
The patch against udev050plus is attached.

Thanks, Tobias

[-- Attachment #2: udev050plus-gcc4-uninitialized-warning.patch --]
[-- Type: text/plain, Size: 615 bytes --]

--- udev-050plus.orig/udev_sysfs.c	2004-12-19 17:42:11.000000000 +0100
+++ udev-050plus/udev_sysfs.c	2005-01-16 19:00:32.978126432 +0100
@@ -381,7 +381,7 @@
 
 struct sysfs_class_device *wait_class_device_open(const char *path)
 {
-	struct sysfs_class_device *class_dev;
+	struct sysfs_class_device *class_dev = NULL;
 	int loop;
 
 	loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
@@ -450,7 +450,7 @@
 
 struct sysfs_device *wait_devices_device_open(const char *path)
 {
-	struct sysfs_device *devices_dev;
+	struct sysfs_device *devices_dev = NULL;
 	int loop;
 
 	loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix GCC4 compile warnings
  2005-01-16 18:09 [PATCH] Fix GCC4 compile warnings Tobias Klauser
@ 2005-01-16 18:31 ` Kay Sievers
  2005-01-16 18:57 ` Kay Sievers
  2005-01-16 19:09 ` Tobias Klauser
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2005-01-16 18:31 UTC (permalink / raw)
  To: linux-hotplug

On Sun, 2005-01-16 at 19:09 +0100, Tobias Klauser wrote:
> I tried to compile udev 050plus with the GCC 4.0 snapshot 200412119 and 
> got two errors about possibly uninitialized structs, so I fixed this. 
> The patch against udev050plus is attached.

Well, these warnings are just wrong! Does this patch avoid the warnings
too? I'm just interested what gcc thinks now. :)

Thanks,
Kay

=== udev_sysfs.c 1.20 vs edited ==--- 1.20/udev_sysfs.c	2004-12-12 00:34:45 +01:00
+++ edited/udev_sysfs.c	2005-01-16 19:24:44 +01:00
@@ -382,9 +382,8 @@
 struct sysfs_class_device *wait_class_device_open(const char *path)
 {
 	struct sysfs_class_device *class_dev;
-	int loop;
+	int loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
 
-	loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
 	while (--loop) {
 		class_dev = sysfs_open_class_device_path(path);
 		if (class_dev)
@@ -451,9 +450,8 @@
 struct sysfs_device *wait_devices_device_open(const char *path)
 {
 	struct sysfs_device *devices_dev;
-	int loop;
+	int loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
 
-	loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
 	while (--loop) {
 		devices_dev = sysfs_open_device_path(path);
 		if (devices_dev)




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix GCC4 compile warnings
  2005-01-16 18:09 [PATCH] Fix GCC4 compile warnings Tobias Klauser
  2005-01-16 18:31 ` Kay Sievers
@ 2005-01-16 18:57 ` Kay Sievers
  2005-01-16 19:09 ` Tobias Klauser
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2005-01-16 18:57 UTC (permalink / raw)
  To: linux-hotplug

On Sun, 2005-01-16 at 19:31 +0100, Kay Sievers wrote:
> On Sun, 2005-01-16 at 19:09 +0100, Tobias Klauser wrote:
> > I tried to compile udev 050plus with the GCC 4.0 snapshot 200412119 and 
> > got two errors about possibly uninitialized structs, so I fixed this. 
> > The patch against udev050plus is attached.
> 
> Well, these warnings are just wrong! Does this patch avoid the warnings
> too? I'm just interested what gcc thinks now. :)

No, it's the same. I've applied your patch to my tree now.

Thanks,
Kay



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix GCC4 compile warnings
  2005-01-16 18:09 [PATCH] Fix GCC4 compile warnings Tobias Klauser
  2005-01-16 18:31 ` Kay Sievers
  2005-01-16 18:57 ` Kay Sievers
@ 2005-01-16 19:09 ` Tobias Klauser
  2 siblings, 0 replies; 4+ messages in thread
From: Tobias Klauser @ 2005-01-16 19:09 UTC (permalink / raw)
  To: linux-hotplug

On 01/16/2005 07:57 PM, Kay Sievers wrote:
> On Sun, 2005-01-16 at 19:31 +0100, Kay Sievers wrote:
>>On Sun, 2005-01-16 at 19:09 +0100, Tobias Klauser wrote:
>>>I tried to compile udev 050plus with the GCC 4.0 snapshot 200412119 and 
>>>got two errors about possibly uninitialized structs, so I fixed this. 
>>>The patch against udev050plus is attached.
>>Well, these warnings are just wrong! Does this patch avoid the warnings
>>too? I'm just interested what gcc thinks now. :)
> 
> No, it's the same. I've applied your patch to my tree now.

I just compiled with the newest GCC4 snapshot 20050109 and it still
behaves the same.

Thanks, Tobias



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-16 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-16 18:09 [PATCH] Fix GCC4 compile warnings Tobias Klauser
2005-01-16 18:31 ` Kay Sievers
2005-01-16 18:57 ` Kay Sievers
2005-01-16 19:09 ` Tobias Klauser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).