From 7acc98727b458fe4047aff4c6070e57267da5240 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 30 Sep 2017 14:55:39 -0600 Subject: [PATCH] Misc fixes for compilation with current SDCC compiler --- include/nuttx/compiler.h | 25 +++++++++++++++++++++++++ include/nuttx/fs/fs.h | 8 -------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 81c716bc07..9ebf675876 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -200,6 +200,7 @@ # define CONFIG_HAVE_FARPOINTER 1 #elif defined(__mc68hc1x__) + /* No I-space access qualifiers */ # define IOBJ @@ -269,10 +270,19 @@ # define CONFIG_CAN_PASS_STRUCTS 1 +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + /* SDCC-specific definitions ************************************************/ #elif defined(SDCC) +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + /* Pre-processor */ # define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ @@ -329,6 +339,10 @@ # define reentrant_function __reentrant +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + /* It is assumed that the system is build using the small * data model with storage defaulting to internal RAM. * The NEAR storage class can also be used to address data @@ -386,6 +400,10 @@ # undef CONFIG_CAN_PASS_STRUCTS +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + /* Zilog-specific definitions ***********************************************/ #elif defined(__ZILOG__) @@ -505,6 +523,10 @@ # define CONFIG_CAN_PASS_STRUCTS 1 +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + /* ICCARM-specific definitions ***********************************************/ #elif defined(__ICCARM__) @@ -533,6 +555,7 @@ # define NEAR # define DSEG # define CODE +# define IOBJ # define IPTR # define __asm__ asm @@ -588,6 +611,8 @@ # undef CONFIG_HAVE_LONG_DOUBLE # undef CONFIG_CAN_PASS_STRUCTS +# define UNUSED(a) ((void)(a)) + #endif /**************************************************************************** diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index 13a993d53e..fd2d44d847 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -644,14 +644,6 @@ int file_dup2(FAR struct file *filep1, FAR struct file *filep2); int fs_dupfd(int fd, int minfd); #endif -/**************************************************************************** - * Name: file_dup - * - * Description: - * Equivalent to the non-standard fs_dupfd() function except that it - * accepts a struct file instance instead of a file descriptor. Currently - * used only by file_vfcntl(); - * /**************************************************************************** * Name: file_dup *