Skip to content

Commit

Permalink
Merge pull request #15 from apinf/hardening/warnings_as_errors_in_ubu…
Browse files Browse the repository at this point in the history
…ntu_1704

Hardening/warnings as errors in ubuntu 1704
  • Loading branch information
kzangeli committed Jan 10, 2018
2 parents 6939479 + b9173da commit 1f09699
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ add_definitions(-fPIC)
#
# A grep of 'std::auto_ptr<' in the header files show 7 hits, and 13 hits in cpp files
#
# In PR https://github.com/apinf/fiware-orion/pull/15, a workaround for Ubuntu is implemented.
# This workaround consists of putting back the -Werror flag and instead solving the problem by
# adding another flag: -Wno-deprecated-declarations
#
IF (${DISTRO} STREQUAL "Ubuntu_17.04")
set (CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -fno-var-tracking-assignments")
set (CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -Werror -Wno-deprecated-declarations -fno-var-tracking-assignments")
ELSE()
set (CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -Werror -fno-var-tracking-assignments")
ENDIF ()
Expand Down
14 changes: 10 additions & 4 deletions src/lib/logMsg/logMsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2905,10 +2905,16 @@ int64_t lmLogLineGet
}

// Set file pointer to the beginning of the fifth line
fgets(line, 1024, fP);
fgets(line, 1024, fP);
fgets(line, 1024, fP);
fgets(line, 1024, fP);
char* fgP;

fgP = fgets(line, 1024, fP);
if (fgP != NULL) fgP = fgets(line, 1024, fP);
if (fgP != NULL) fgP = fgets(line, 1024, fP);
if (fgP != NULL) fgP = fgets(line, 1024, fP);
if (fgP == NULL)
{
goto lmerror;
}
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/lib/rest/HttpHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
*
* CORS Allowed Headers -
*/
#define CORS_ALLOWED_HEADERS CONTENT_TYPE", "FIWARE_SERVICE", "FIWARE_SERVICEPATH", "NGSIV2_ATTRSFORMAT", "FIWARE_CORRELATOR", "X_FORWARDED_FOR", "X_REAL_IP", "X_AUTH_TOKEN
#define CORS_ALLOWED_HEADERS CONTENT_TYPE ", " FIWARE_SERVICE ", " FIWARE_SERVICEPATH ", " NGSIV2_ATTRSFORMAT ", " FIWARE_CORRELATOR ", " X_FORWARDED_FOR ", " X_REAL_IP ", " X_AUTH_TOKEN



/* ****************************************************************************
*
* CORS Exposed Headers -
*/
#define CORS_EXPOSED_HEADERS FIWARE_CORRELATOR", "FIWARE_TOTAL_COUNT", "RESOURCE_LOCATION
#define CORS_EXPOSED_HEADERS FIWARE_CORRELATOR ", " FIWARE_TOTAL_COUNT ", " RESOURCE_LOCATION



Expand Down

0 comments on commit 1f09699

Please sign in to comment.