]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove unwanted "volatile" from static variable used with g_once_init_enter()
authorJohn Wolfe <jwolfe@vmware.com>
Thu, 20 May 2021 18:38:38 +0000 (11:38 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Thu, 20 May 2021 18:38:38 +0000 (11:38 -0700)
The glib api documentation for g_once_init_enter() specifically states
that "volatile" should NOT be used with the address passed as the
argument.  Recent compilers (GCC-11 & clang 11) and recent versions of
glib-2 will result in a warning that the "volatile" qualifier has been
dropped if it has been used.

Remove the unneeded and unwanted "volatile" qualifier from the definition
of "inited" in pollGtk.c.

Fixes: https://github.com/vmware/open-vm-tools/issues/509
open-vm-tools/lib/pollGtk/pollGtk.c

index 4ccaeda6452dc813b464f531bfd95cacd79cc333..48b49617eb3db16ab407253f5e7b542b7b71f163 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2004-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2019,2021 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -127,7 +127,7 @@ typedef struct Poll {
 } Poll;
 
 static Poll *pollState;
-static volatile gsize inited = 0;
+static gsize inited = 0;
 
 static VMwareStatus
 PollGtkCallback(PollClassSet classSet,   // IN