gazebosim / gz-transport

Transport library for component communication based on publication/subscription and service calls.
https://gazebosim.org
Apache License 2.0
29 stars 43 forks source link

Lots of compiler warnings in downstream code #20

Closed osrf-migration closed 9 years ago

osrf-migration commented 10 years ago

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


When building haptix_comm, I get a lot of warnings about some unknown pragmas:

In file included from devel_isolated/ign-transport/include/ignition/transport.hh:3:0,
                 from src/haptix_comm/src/haptix.cc:20:
devel_isolated/ign-transport/include/ignition/transport/Discovery.hh:21:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(push, 0)
 ^
In file included from devel_isolated/ign-transport/include/ignition/transport.hh:3:0,
                 from src/haptix_comm/src/haptix.cc:20:
devel_isolated/ign-transport/include/ignition/transport/Discovery.hh:25:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(pop)
 ^
osrf-migration commented 10 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


@_jrivero_

osrf-migration commented 10 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


@nkoenig stackoverflow recommends ifdef's (I think this is what you did):

http://stackoverflow.com/questions/4193476/is-using-pragma-warning-push-pop-the-right-way-to-temporarily-alter-warning-lev/4194047#4194047

#ifdef _MSC_VER
 #pragma warning( push )
 #pragma warning( once: ThatWarning )
#endif
 //code with ThatWarning here
#ifdef _MSC_VER
 #pragma warning( pop )
#endif
osrf-migration commented 10 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


Yes, that is what I did. I agree that it's ugly, but it's no more ugly than the existing pragmas. We should put in those changes, otherwise it's difficult to find compiler errors.

osrf-migration commented 10 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


osrf-migration commented 10 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


pull request #32

osrf-migration commented 9 years ago

Original comment by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).


Fixed in pull request #32