Suppressing 'warning: unused parameter ... [-Wunused-parameter]'

This commit is contained in:
lacklustrlabs 2017-11-15 23:19:31 +01:00
parent a7503e1d30
commit 8d9e2f24b6
21 changed files with 150 additions and 150 deletions

View File

@ -203,7 +203,7 @@ void adc_foreach(void (*fn)(adc_dev*)) {
#endif
}
void adc_config_gpio(adc_dev *ignored, gpio_dev *gdev, uint8 bit) {
void adc_config_gpio(adc_dev *ignored __attribute__((unused)), gpio_dev *gdev, uint8 bit) {
gpio_set_mode(gdev, bit, GPIO_INPUT_ANALOG);
}

View File

@ -54,7 +54,7 @@ spi_dev *SPI3 = &spi3;
* Routines
*/
void spi_config_gpios(spi_dev *ignored,
void spi_config_gpios(spi_dev *ignored __attribute__((unused)),
uint8 as_master,
gpio_dev *nss_dev,
uint8 nss_bit,

View File

@ -327,7 +327,7 @@ static void output_compare_mode(timer_dev *dev, uint8 channel) {
}
//added by CARLOS.
static void encoder_mode(timer_dev *dev, uint8 channel) {
static void encoder_mode(timer_dev *dev, uint8 channel __attribute__((unused))) {
//prescaler.
//(dev->regs).gen->PSC = 1;

View File

@ -88,7 +88,7 @@ void _fail(const char* file, int line, const char* exp) {
* Provide an __assert_func handler to libc so that calls to assert()
* get redirected to _fail.
*/
void __assert_func(const char* file, int line, const char* method,
void __assert_func(const char* file, int line, const char* method __attribute__((unused)),
const char* expression) {
_fail(file, line, expression);
}

View File

@ -26,7 +26,7 @@
* to be slighly more accurate the maxLoops variable really needs to take into account the loop setup code, but its probably as good as necessary
*
*/
uint32_t pulseIn( uint32_t pin, uint32_t state, uint32_t timeout )
uint32_t pulseIn( uint32_t pin, uint32_t state __attribute__((unused)), uint32_t timeout )
{
// cache the port and bit of the pin in order to speed up the
// pulse width measuring loop and achieve finer resolution. calling

View File

@ -236,7 +236,7 @@ enum reset_state_t {
static reset_state_t reset_state = DTR_UNSET;
static void ifaceSetupHook(unsigned hook, void *requestvp) {
static void ifaceSetupHook(unsigned hook __attribute__((unused)), void *requestvp) {
uint8 request = *(uint8*)requestvp;
// Ignore requests we're not interested in.
@ -290,7 +290,7 @@ static void wait_reset(void) {
#define STACK_TOP 0x20000800
#define EXC_RETURN 0xFFFFFFF9
#define DEFAULT_CPSR 0x61000000
static void rxHook(unsigned hook, void *ignored) {
static void rxHook(unsigned hook __attribute__((unused)), void *ignored __attribute__((unused))) {
/* FIXME this is mad buggy; we need a new reset sequence. E.g. NAK
* after each RX means you can't reset if any bytes are waiting. */
if (reset_state == DTR_NEGEDGE) {

View File

@ -41,7 +41,7 @@
#include "WireBase.h"
#include "wirish.h"
void WireBase::begin(uint8 self_addr) {
void WireBase::begin(uint8 self_addr __attribute__((unused))) {
tx_buf_idx = 0;
tx_buf_overflow = false;
rx_buf_idx = 0;

View File

@ -59,7 +59,7 @@ extern i2c_dev* const I2C2;
* For internal use
*/
static inline uint32 _i2c_bus_clk(i2c_dev *dev) {
static inline uint32 _i2c_bus_clk(i2c_dev *dev __attribute__((unused))) {
/* Both I2C peripherals are on APB1 */
return STM32_PCLK1 / (1000 * 1000);
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,15 +76,15 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
@ -97,7 +97,7 @@ __weak int isatty(int fd) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}

View File

@ -76,28 +76,28 @@ void *_sbrk(int incr) {
return ret;
}
__weak int _open(const char *path, int flags, ...) {
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1;
}
__weak int _close(int fd) {
__weak int _close(int fd __attribute__((unused))) {
return 0;
}
__weak int _fstat(int fd, struct stat *st) {
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR;
return 0;
}
__weak int _isatty(int fd) {
__weak int _isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int isatty(int fd) {
__weak int isatty(int fd __attribute__((unused))) {
return 1;
}
__weak int _lseek(int fd, off_t pos, int whence) {
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1;
}
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
}
__weak int _read(int fd, char *buf, size_t cnt) {
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch();
return 1;
}
__weak void putch(unsigned char c) {
__weak void putch(unsigned char c __attribute__((unused))) {
}
__weak void cgets(char *s, int bufsize) {
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
return;
}
__weak int _write(int fd, const char *buf, size_t cnt) {
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i;
for (i = 0; i < cnt; i++)
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
}
/* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f) {
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize);
return s;
}
__weak void _exit(int exitcode) {
__weak void _exit(int exitcode __attribute__((unused))) {
while (1)
;
}