From: John Wolfe Date: Thu, 20 May 2021 18:38:38 +0000 (-0700) Subject: Remove unwanted "volatile" from static variable used with g_once_init_enter() X-Git-Tag: stable-11.3.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2c8baeaa8ac365e1445f941cf1b80999ed89a9d;p=thirdparty%2Fopen-vm-tools.git Remove unwanted "volatile" from static variable used with g_once_init_enter() 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 --- diff --git a/open-vm-tools/lib/pollGtk/pollGtk.c b/open-vm-tools/lib/pollGtk/pollGtk.c index 4ccaeda64..48b49617e 100644 --- a/open-vm-tools/lib/pollGtk/pollGtk.c +++ b/open-vm-tools/lib/pollGtk/pollGtk.c @@ -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