Browse Source

Fixed gcc 4.8 warnings

Disabled gcc warnings that are tripped by Eigen.

Removed signal code that is not needed in Linux port and was
causing gcc warnings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
sbg
Mark Charlebois 10 years ago
parent
commit
e3f137ce23
  1. 4
      makefiles/toolchain_native.mk
  2. 22
      src/platforms/linux/px4_layer/px4_linux_impl.cpp
  3. 2
      src/systemcmds/param/param.c

4
makefiles/toolchain_native.mk

@ -61,7 +61,7 @@ CLANGVER= @@ -61,7 +61,7 @@ CLANGVER=
endif
endif
#USE_GCC=1
USE_GCC=0
ifeq ($(USE_GCC),1)
# GCC Options:
@ -162,6 +162,8 @@ ARCHWARNINGS += -Wdouble-promotion \ @@ -162,6 +162,8 @@ ARCHWARNINGS += -Wdouble-promotion \
-Wlogical-op \
-Wformat=1 \
-Werror=unused-but-set-variable \
-Wno-error=unused-local-typedefs \
-Wno-error=enum-compare \
-Werror=double-promotion
ARCHOPTIMIZATION += -fno-strength-reduce
endif

22
src/platforms/linux/px4_layer/px4_linux_impl.cpp

@ -49,39 +49,17 @@ @@ -49,39 +49,17 @@
__BEGIN_DECLS
// FIXME - This needs to be properly initialized
struct param_info_s param_array[256];
struct param_info_s *param_info_base;
struct param_info_s *param_info_limit;
long PX4_TICKS_PER_SEC = sysconf(_SC_CLK_TCK);
__END_DECLS
extern struct wqueue_s gwork[NWORKERS];
void sighandler(int sig)
{
printf("Received sig %d\n", sig);
}
namespace px4
{
void init(int argc, char *argv[], const char *app_name)
{
int ret;
struct sigaction actions;
memset(&actions, 0, sizeof(actions));
sigemptyset(&actions.sa_mask);
actions.sa_flags = 0;
actions.sa_handler = sighandler;
ret = sigaction(SIGUSR2,&actions,NULL);
if (ret < 0) {
printf("sigaction failed: %d\n", errno);
}
printf("App name: %s\n", app_name);
// Create high priority worker thread

2
src/systemcmds/param/param.c

@ -182,7 +182,7 @@ static int @@ -182,7 +182,7 @@ static int
do_save(const char *param_file_name)
{
/* create the file */
int fd = open(param_file_name, O_WRONLY | O_CREAT);
int fd = open(param_file_name, O_WRONLY | O_CREAT, 0x777);
if (fd < 0) {
warn("opening '%s' failed", param_file_name);

Loading…
Cancel
Save