1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00

Turn on -Werror on openpilot firmware build

This commit fixes all existing warnings.

All basic compiler warnings will now be treated as errors.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@658 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
stac 2010-05-24 16:33:46 +00:00 committed by stac
parent 46101794e3
commit 874239154a
4 changed files with 16 additions and 3 deletions

View File

@ -399,7 +399,7 @@ ifeq ($(CODE_SOURCERY), YES)
CFLAGS += -fpromote-loop-indices CFLAGS += -fpromote-loop-indices
endif endif
CFLAGS += -Wall CFLAGS += -Wall -Werror
CFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<)))) CFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<))))
# Compiler flags to generate dependency files: # Compiler flags to generate dependency files:
CFLAGS += -MD -MP -MF $(OUTDIR)/dep/$(@F).d CFLAGS += -MD -MP -MF $(OUTDIR)/dep/$(@F).d

View File

@ -44,17 +44,22 @@
/* Global Variables */ /* Global Variables */
/* Local Variables */ /* Local Variables */
#define INCLUDE_TEST_TASKS 0
#if INCLUDE_TEST_TASKS
static uint8_t sdcard_available; static uint8_t sdcard_available;
#endif
FILEINFO File; FILEINFO File;
char Buffer[1024]; char Buffer[1024];
uint32_t Cache; uint32_t Cache;
/* Function Prototypes */ /* Function Prototypes */
#if INCLUDE_TEST_TASKS
static void TaskTick(void *pvParameters); static void TaskTick(void *pvParameters);
static void TaskTesting(void *pvParameters); static void TaskTesting(void *pvParameters);
static void TaskHIDTest(void *pvParameters); static void TaskHIDTest(void *pvParameters);
static void TaskServos(void *pvParameters); static void TaskServos(void *pvParameters);
static void TaskSDCard(void *pvParameters); static void TaskSDCard(void *pvParameters);
#endif
int32_t CONSOLE_Parse(COMPortTypeDef port, char c); int32_t CONSOLE_Parse(COMPortTypeDef port, char c);
void OP_ADC_NotifyChange(uint32_t pin, uint32_t pin_value); void OP_ADC_NotifyChange(uint32_t pin, uint32_t pin_value);
@ -146,6 +151,7 @@ void OpenPilotInit()
//xTaskCreate(TaskSDCard, (signed portCHAR *)"SDCard", configMINIMAL_STACK_SIZE, NULL, (tskIDLE_PRIORITY + 2), NULL); //xTaskCreate(TaskSDCard, (signed portCHAR *)"SDCard", configMINIMAL_STACK_SIZE, NULL, (tskIDLE_PRIORITY + 2), NULL);
} }
#if INCLUDE_TEST_TASKS
static void TaskTesting(void *pvParameters) static void TaskTesting(void *pvParameters)
{ {
portTickType xDelay = 250 / portTICK_RATE_MS; portTickType xDelay = 250 / portTICK_RATE_MS;
@ -200,7 +206,9 @@ static void TaskTesting(void *pvParameters)
vTaskDelay(xDelay); vTaskDelay(xDelay);
} }
} }
#endif
#if INCLUDE_TEST_TASKS
static void TaskHIDTest(void *pvParameters) static void TaskHIDTest(void *pvParameters)
{ {
uint8_t byte; uint8_t byte;
@ -240,7 +248,9 @@ static void TaskHIDTest(void *pvParameters)
} }
} }
} }
#endif
#if INCLUDE_TEST_TASKS
static void TaskServos(void *pvParameters) static void TaskServos(void *pvParameters)
{ {
/* For testing servo outputs */ /* For testing servo outputs */
@ -308,7 +318,9 @@ static void TaskServos(void *pvParameters)
} }
} }
} }
#endif
#if INCLUDE_TEST_TASKS
static void TaskSDCard(void *pvParameters) static void TaskSDCard(void *pvParameters)
{ {
uint16_t second_delay_ctr = 0; uint16_t second_delay_ctr = 0;
@ -347,4 +359,5 @@ static void TaskSDCard(void *pvParameters)
} }
} }
} }
#endif

View File

@ -53,7 +53,7 @@ int dosfs_ini_read(char *buffer, int size, PFILEINFO file)
return 1; return 1;
} }
int dosfs_ini_write(char *buffer, PFILEINFO file) int dosfs_ini_write(const char *buffer, PFILEINFO file)
{ {
/* TODO: Check this works */ /* TODO: Check this works */
DFS_WriteFile(file, PIOS_SDCARD_Sector, (uint8_t *)buffer, &SuccessCount, sizeof(buffer)); DFS_WriteFile(file, PIOS_SDCARD_Sector, (uint8_t *)buffer, &SuccessCount, sizeof(buffer));

View File

@ -21,7 +21,7 @@ extern int dosfs_ini_openread(const char *filename, PFILEINFO file);
extern int dosfs_ini_openwrite(const char *filename, PFILEINFO file); extern int dosfs_ini_openwrite(const char *filename, PFILEINFO file);
extern int dosfs_ini_close(PFILEINFO file); extern int dosfs_ini_close(PFILEINFO file);
extern int dosfs_ini_read(char *buffer, int size, PFILEINFO file); extern int dosfs_ini_read(char *buffer, int size, PFILEINFO file);
extern int dosfs_ini_write(char *buffer, PFILEINFO file); extern int dosfs_ini_write(const char *buffer, PFILEINFO file);
extern int dosfs_ini_rename(const char *source, const char *dest); extern int dosfs_ini_rename(const char *source, const char *dest);
extern int dosfs_ini_remove(const char *filename); extern int dosfs_ini_remove(const char *filename);
extern int dosfs_ini_rewind(PFILEINFO file); extern int dosfs_ini_rewind(PFILEINFO file);