mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
Werror: Enable warnings as errors
Added C/CXX warning messages similar to MRAA (w/ -Werror). * Added syslog warning for missing switch cases * Cleaned up uint vs int usage * Fixed redifinition errors for C structs * Added virtual destructors for base classes * Removed redundant CMAKE_CXX_FLAGS from COMPILE_FLAGS for all three wrapper languages. The CMAKE_CXX_FLAGS were showing up twice in the compile commands for the wrappers. * Added CMake WERROR option to enable/disable warnings as errors for all targets. * Disable a handful of compiler warnings for the wrapper cxx files, this minimizes the number of warnings from auto-generated code). Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
@ -54,6 +54,12 @@ macro(add_example example_name)
|
||||
set(example_bin "${example_name}-example-cxx")
|
||||
get_module_name(${example_name} module_name)
|
||||
set(module_dir "${PROJECT_SOURCE_DIR}/src/${module_name}")
|
||||
|
||||
# nrf examples can flag a warning, make sure this isn't an error, currently
|
||||
# this is done for all examples
|
||||
set_source_files_properties(${example_src}
|
||||
PROPERTIES COMPILE_FLAGS -Wno-tautological-compare)
|
||||
|
||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${example_src}"
|
||||
AND EXISTS ${module_dir}
|
||||
AND IS_DIRECTORY ${module_dir})
|
||||
|
@ -35,7 +35,7 @@ void printTime(upm::DS1307 *rtc)
|
||||
<< rtc->hours << ":" << rtc->minutes << ":" << rtc->seconds;
|
||||
|
||||
if (rtc->amPmMode)
|
||||
cout << (rtc->pm) ? " PM " : " AM ";
|
||||
cout << ((rtc->pm) ? " PM " : " AM ");
|
||||
|
||||
cout << endl;
|
||||
|
||||
|
@ -122,6 +122,8 @@ main(int argc, char **argv)
|
||||
lib_aci_broadcast(10/* in seconds */, 0x0100 /* advertising interval 100ms */);
|
||||
printf ("Broadcasting started\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break; //ACI Device Started Event
|
||||
@ -156,6 +158,8 @@ main(int argc, char **argv)
|
||||
case ACI_EVT_HW_ERROR:
|
||||
printf ("ACI_EVT_HW_ERROR\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,6 +239,8 @@ main(int argc, char **argv)
|
||||
printf ("Advertising started \n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break; // ACI Device Started Event
|
||||
@ -335,7 +337,8 @@ main(int argc, char **argv)
|
||||
lib_aci_connect(0/* in seconds, 0 means forever */, 0x0050 /* advertising interval 50ms*/);
|
||||
printf ("Advertising started \n");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ sig_handler(int signo)
|
||||
|
||||
void
|
||||
handler (clbk_data data) {
|
||||
printf ("callback data (%d)\n", data);
|
||||
printf ("callback data (%d)\n", data.is_heart_beat);
|
||||
}
|
||||
|
||||
int
|
||||
@ -51,7 +51,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
//! [Interesting]
|
||||
Pulsensor *sensor = new Pulsensor(handler);
|
||||
|
||||
|
||||
sensor->start_sampler();
|
||||
while (!doWork) {
|
||||
usleep (5);
|
||||
|
@ -95,7 +95,7 @@ int main(int argc, char **argv)
|
||||
// receiving
|
||||
cout << "Attempting to receive..." << endl;
|
||||
int rv;
|
||||
if (rv = sensor->setRx(3000))
|
||||
if ((rv = sensor->setRx(3000)))
|
||||
{
|
||||
cout << "setRx returned " << rv << endl;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ int main(int argc, char **argv)
|
||||
// receiving
|
||||
cout << "Attempting to receive..." << endl;
|
||||
int rv;
|
||||
if (rv = sensor->setRx(3000))
|
||||
if ((rv = sensor->setRx(3000)))
|
||||
{
|
||||
cout << "setRx returned " << rv << endl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user