[CDRIVER-2249] Thousands of warnings with MSVC like "'4' bytes padding added after data member" Created: 21/Aug/17 Updated: 28/Oct/23 Resolved: 23/Aug/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | Build |
| Affects Version/s: | 1.7.0 |
| Fix Version/s: | 1.8.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
As a consequence of adding the ENABLE_MAINTAINER_FLAGS option to CMakeLists.txt: https://github.com/mongodb/mongo-c-driver/commit/34c5c96985eb9bdcb669502cf7cd126fb21c4248 There are now thousands of worthless warnings like this when compiling with MSVC in our Evergreen build:
The problem seems to be MSVC can accept the "-Wall" flag, but it's badly implemented. MSVC shouldn't warn about code in system headers, but it does, and perhaps these "padding" warnings are completely spurious no matter where they originate. MSVC doesn't accept any other GCC-style warning options like "-Wformat", so it's a waste of time for CMake to check each of them. To resolve this, let's skip the entire warning-flags configuration step if the compiler is MSVC. |
| Comments |
| Comment by Ramon Fernandez Marina [ 12/Sep/17 ] |
|
Author: {'username': u'ajdavis', 'name': u'A. Jesse Jiryu Davis', 'email': u'jesse@mongodb.com'}Message: MSVC accepts "-Wall" but it results in thousands of spurious warnings. |
| Comment by Ramon Fernandez Marina [ 12/Sep/17 ] |
|
Author: {'username': u'ajdavis', 'name': u'A. Jesse Jiryu Davis', 'email': u'jesse@mongodb.com'}Message: MSVC accepts "-Wall" but it results in thousands of spurious warnings. |
| Comment by A. Jesse Jiryu Davis [ 23/Aug/17 ] |
|
https://github.com/mongodb/libbson/commit/28077f6ff1f1dfd523d4fdda619dae2c9b4347a3 https://github.com/mongodb/mongo-c-driver/commit/b9f2ff2426784362b9521a72261c1470013a8101 |