Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gtk issues using GCC 11 with gtk >= 3.20 #505

Closed
wants to merge 1 commit into from

Conversation

LaneWolf
Copy link

Newer gcc is more strict when detecting issues. To be able to properly
build open-vm-tools, following fixes has to be done:

  1. gdk_display_get_device_manager was deprecated and this is properly
    detected by compiler and cause warning.
    Use newer gdk_display_get_default_seat function.

  2. Several gtk files can be no longer compiled using extern C and they
    have to be in full C++ code.

  3. Return value from read function has to be used otherwise produce
    unused variable warning. Not working with the return value cause
    unused result warning. This can be avoided using dummy retyping
    in case return value is not used.

Signed-off-by: Miroslav Rezanina mrezanin@redhat.com

Newer gcc is more strict when detecting issues. To be able to properly
build open-vm-tools, following fixes has to be done:

1) gdk_display_get_device_manager was deprecated and this is properly
   detected by compiler and cause warning.
   Use newer gdk_display_get_default_seat function.

2) Several gtk files can be no longer compiled using extern C and they
   have to be in full C++ code.

3) Return value from read function has to be used otherwise produce
   unused variable warning. Not working with the return value cause
   unused result warning. This can be avoided using dummy retyping
   in case return value is not used.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
@vmwclabot
Copy link
Member

@LaneWolf, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@johnwvmw
Copy link
Contributor

@LaneWolf Thanks for your contribution. Based on the need to remain conformant with newer compilers and compatible with newer OSS release, we will expedite the integration of the patch into the open-vm-tools source.

An update will be provided once the fix is available on the "devel" branch.

@vmwclabot
Copy link
Member

@LaneWolf, VMware has approved your signed contributor license agreement.

johnwvmw added a commit that referenced this pull request Apr 19, 2021
With glib2.0 releases >= 2.66.3, glib header files inside an
extern "C" block will encounter compilation errors.  This has
impacted several OSS packages.  Consumers of newer versions of glib2.0
must not include glib headers in an extern "C" block.

GTK 3.20 has deprecated gdk_display_get_device_manager(); using the
newer gdk_display_get_default_seat() when the GTK version is >= 3.20.

The return value from read() must be used to avoid an unused result
warning from the compiler.  This can be avoided by using dummy retyping
in the case where the return value is not used or in this case, using
the returned value in a debug log message.

Pull Request: #505
Addresses:    #500
Addresses:    #509
@johnwvmw
Copy link
Contributor

@LaneWolf

This issues has been fixed with change 82931a1 on the "devel" branch. This will be part of the next major open-vm-tools release, but the change can be applied to the 11.2.5 open-vm-tools source release.

The final changes are slightly different than that submitted and tested. The changes were made to address style nag messages from clang_format and avoid build breakage in other products using common source files and headers.

Closing this issue; please reopen if you have any concerns or problems.

@johnwvmw johnwvmw closed this Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants