Skip to content

Commit

Permalink
Merge pull request uber#90 from isaacbrodsky/warnings-as-errors-only-…
Browse files Browse the repository at this point in the history
…in-ci

Make warnings errors default only in Travis
  • Loading branch information
isaacbrodsky authored Jul 11, 2018
2 parents e77a664 + bc2003d commit 0cf6aaa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ matrix:
install:
- pip install --user cpp-coveralls
before_script:
- cmake -DCMAKE_BUILD_TYPE=Debug .
- cmake -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=ON .
script:
- make && make coverage
after_success:
Expand All @@ -62,7 +62,7 @@ matrix:
before_script:
- mkdir build
- cd build
- cmake ..
- cmake -DWARNINGS_AS_ERRORS=ON ..

# Build and test the library, then build and test the examples.
script:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ The public API of this library consists of the functions declared in file
- Added Direction enum, replacing int and defined constants (#77)
### Fixed
- Ensured unused memory is cleared for pentagon children. (#84)
- Fixed compiler warnings in `h3ToGeoHier` and `h3ToGeoBoundaryHier`. (#90)
### Changed
- Warnings are not errors by default. (#90)

## [3.0.7] - 2018-06-08
### Added
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if(NOT WIN32)
list(APPEND H3_LINK_FLAGS $<$<CONFIG:DEBUG>:--coverage>)
endif()

option(WARNINGS_AS_ERRORS "Warnings are treated as errors" ON)
option(WARNINGS_AS_ERRORS "Warnings are treated as errors" OFF)
if(WARNINGS_AS_ERRORS)
list(APPEND H3_COMPILE_FLAGS -Werror)
endif()
Expand Down
9 changes: 3 additions & 6 deletions src/apps/miscapps/h3ToGeoBoundaryHier.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
* San Francisco
*/

#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -124,16 +125,12 @@ int main(int argc, char* argv[]) {
error("outputMode must be 0 or 1");

if (isKmlOut) {
char index[BUFF_SIZE];
char name[BUFF_SIZE];
char desc[BUFF_SIZE];

H3_EXPORT(h3ToString)(rootCell, index, BUFF_SIZE);
sprintf(name, "Cell %s Res %d", index,
sprintf(name, "Cell %" PRIx64 " Res %d", rootCell,
((res <= rootRes) ? rootRes : res));
sprintf(desc, "cell boundary");

kmlBoundaryHeader(name, desc);
kmlBoundaryHeader(name, "cell boundary");
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions src/apps/miscapps/h3ToGeoHier.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* San Francisco.
*/

#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -125,16 +126,12 @@ int main(int argc, char* argv[]) {
error("outputMode must be 0 or 1");

if (isKmlOut) {
char index[BUFF_SIZE];
char name[BUFF_SIZE];
char desc[BUFF_SIZE];

H3_EXPORT(h3ToString)(rootCell, index, BUFF_SIZE);
sprintf(name, "Cell %s Res %d", index,
sprintf(name, "Cell %" PRIx64 " Res %d", rootCell,
((res <= rootRes) ? rootRes : res));
sprintf(desc, "cell boundary");

kmlBoundaryHeader(name, desc);
kmlBoundaryHeader(name, "cell center");
}
}
}
Expand Down

0 comments on commit 0cf6aaa

Please sign in to comment.