Opened 13 years ago

Closed 4 years ago

#4014 closed Patches (fixed)

[PATCH] boost/gil gcc warning cleanup

Reported by: Tatu Kilappa <tatu.kilappa@…> Owned by: Stefan Seefeld
Milestone: Boost 1.43.0 Component: gil USE GITHUB
Version: Boost Development Trunk Severity: Cosmetic
Keywords: gcc warning Cc: mateusz@…, Mateusz Loskot

Description

Patch to clean up excessive gcc 4.x warning barf.

To reproduce, compile any gil-using program with: -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Werror=return-type -Wextra -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wno-multichar -Wpacked -Wredundant-decls -Wshadow -Wswitch-default -Wundef -Wwrite-strings -Wctor-dtor-privacy -Werror=non-virtual-dtor -Woverloaded-virtual

Attached patch fixes the issue.

Attachments (2)

boost_gil_gcc_warning_cleanup.diff (18.2 KB ) - added by Tatu Kilappa <tatu.kilappa@…> 13 years ago.
build.7z (97.8 KB ) - added by Mateusz Loskot 4 years ago.
Complete build log generated by b2 toolset=gcc using GCC 7.3 and all the compilation flags suggested by the ticket's reporter

Download all attachments as: .zip

Change History (6)

by Tatu Kilappa <tatu.kilappa@…>, 13 years ago

comment:1 by Mateusz Loskot, 6 years ago

Cc: mateusz@… added

comment:2 by Stefan Seefeld, 5 years ago

Owner: changed from Hailin Jin to Stefan Seefeld

comment:3 by Mateusz Loskot, 4 years ago

Cc: Mateusz Loskot added

by Mateusz Loskot, 4 years ago

Attachment: build.7z added

Complete build log generated by b2 toolset=gcc using GCC 7.3 and all the compilation flags suggested by the ticket's reporter

comment:4 by Mateusz Loskot, 4 years ago

Resolution: fixed
Status: newclosed

Most of the warnings cleaned by the patch are -Wshadow diagnostics for constructor parameter/class member of the same name. Use of the same constructor parameter/class member names is fine C++ and I don't think we need any changes here.

I attached complete build log generated by b2 toolset=gcc using GCC 7.3 and all the compilation flags suggested by the ticket's reporter and I no longer see any

warning: declaration of ... shadows a member of...

related to the suggested patch.

As for the io_error function, it also seems no longer necessary. BTW, GIL in Boost 1.68 delivers completely re-implemented I/O extensions. The new version does provide custom error_exit which does not call hard exit() to abort the application, so the issue should be gone now.

Closing as fixed.

github ref: https://github.com/boostorg/gil/projects/4#card-12435867

Note: See TracTickets for help on using tickets.