newlib-cygwin/libgloss
Stafford Horne 8e53c58759 or1k: Fix compiler warnings
In my build the below are treated as error now and causing failures.  I
have described the fixes of each warning below.

In newlib/libc/sys/or1k/mlock.c:

      CC       libc/sys/or1k/libc_a-mlock.o
    newlib/libc/sys/or1k/mlock.c: In function ‘__malloc_lock’:
    newlib/libc/sys/or1k/mlock.c:56:19: warning: implicit declaration of function ‘or1k_critical_begin’ [-Wimplicit-function-declaration]
       56 |         restore = or1k_critical_begin();
	  |                   ^~~~~~~~~~~~~~~~~~~
    newlib/libc/sys/or1k/mlock.c: In function ‘__malloc_unlock’:
    newlib/libc/sys/or1k/mlock.c:93:17: warning: implicit declaration of function ‘or1k_critical_end’ [-Wimplicit-function-declaration]
       93 |                 or1k_critical_end(restore);
	  |                 ^~~~~~~~~~~~~~~~~

This patch adds prototypes for functions or1k_critical_begin and
or1k_critical_end to suppress the warning, inline with what we do for
or1k_sync_cas.

In libgloss/or1k/or1k_uart.c:

    libgloss/or1k/or1k_uart.c: In function ‘or1k_uart_set_read_cb’:
    libgloss/or1k/or1k_uart.c:163:25: warning: passing argument 2 of ‘or1k_interrupt_handler_add’ from incompatible pointer type [-Wincompatible-pointer-types]
      163 |                         _or1k_uart_interrupt_handler, 0);
	  |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
	  |                         |
	  |                         void (*)(uint32_t) {aka void (*)(long unsigned int)}
    In file included from libgloss/or1k/or1k_uart.c:19:
    libgloss/or1k/include/or1k-support.h:97:45: note: expected ‘or1k_interrupt_handler_fptr’ {aka ‘void (*)(void *)’} but argument is of type ‘void (*)(uint32_t)’ {aka ‘void (*)(long unsigned int)’}
       97 |                 or1k_interrupt_handler_fptr handler,
	  |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

The public API is ‘void (*)(void *)' for our interrupt handlers.  The
function _or1k_uart_interrupt_hander is the internal default
implementation of the uart IRQ handler and it doesn't use the data
argument.

This patch updates the _or1k_uart_interrupt_handler argument type from
uint32_t to void* allowing the function prototype to match the required
prototype.

If we did have a 64-bit implementation it would be an ABI issue. But,
there never has been one, or1k is only 32-bit.

In libgloss/or1k/interrupts.c:

    libgloss/or1k/interrupts.c: In function ‘or1k_interrupt_handler_add’:
    libgloss/or1k/interrupts.c:41:52: warning: assignment to ‘void *’ from ‘long unsigned int’ makes pointer from integer without a cast [-Wint-conversion]
       41 |         _or1k_interrupt_handler_data_ptr_table[id] = (uint32_t) data_ptr;
	  |                                                    ^

The table _or1k_interrupt_handler_data_ptr_table is an array of void*
and data_ptr is void*.  There is no need for the cast so remove it.

In libgloss/or1k/sbrk.c:

    libgloss/or1k/sbrk.c:23:29: warning: initialization of ‘uint32_t’ {aka ‘long unsigned int’} from ‘uint32_t *’ {aka ‘long unsigned int *’} makes integer from pointer without a cast [-Wint-conversion]
       23 | uint32_t _or1k_heap_start = &end;
	  |

This patch adds a cast, which is safe in or1k as the architecture in
32-bit only.  But this code would not be 64-compatible.

Signed-off-by: Stafford Horne <shorne@gmail.com>
2024-12-16 10:24:53 +01:00
..
aarch64 libgloss: merge aarch64 into top-level Makefile 2023-01-09 21:49:50 -05:00
arc arc: libgloss: Prepare for porting to ARCv3 2024-08-20 18:24:15 -04:00
arc64 arc64: Add port for Synopsys DesignWare ARCv3 ISA 2024-08-21 15:32:22 -04:00
arm arm: emit .type %function directive in FUNC_START macro 2024-06-26 09:02:32 +00:00
bfin libgloss fix for bfin port 2023-12-18 21:29:51 -07:00
config libgloss: xc16x: drop old stub port 2024-01-19 22:47:00 -05:00
cr16 libgloss: merge cr16 into top-level Makefile 2024-01-23 08:19:54 -05:00
cris libgloss: cris: Correct lcrt0.c for C23 2024-11-18 01:02:09 +01:00
crx libgloss: fix more missing dir with parallel install 2022-01-29 01:33:49 -05:00
csky libgloss: csky: fix pointer-to-integer warning 2023-01-13 17:24:17 -05:00
d30v libgloss: merge d30v into top-level Makefile 2023-01-11 08:42:19 -05:00
doc libgloss: doc: unify duplicate copyright/license content 2024-01-22 20:41:22 -05:00
epiphany libgloss: merge epiphany into top-level Makefile 2024-01-19 22:23:47 -05:00
fr30 libgloss: merge fr30 into top-level Makefile 2024-01-19 22:23:47 -05:00
frv libgloss: merge frv into top-level Makefile 2024-01-19 20:26:52 -05:00
ft32 libgloss: merge ft32 into top-level Makefile 2024-01-19 22:23:47 -05:00
hp74x libgloss: fix up incorrect "it's" 2024-01-03 00:14:42 -05:00
i386 libgloss: merge i386 into top-level Makefile 2024-01-19 20:26:52 -05:00
i960 libgloss: merge i960 into top-level Makefile 2024-01-03 03:49:10 -05:00
iq2000 Fix iq2000 libgloss for c99/gcc-14 2023-12-21 12:43:27 -07:00
libnosys arc64: Add port for Synopsys DesignWare ARCv3 ISA 2024-08-21 15:32:22 -04:00
lm32 libgloss: merge lm32 into top-level Makefile 2022-03-01 20:29:07 -05:00
m32c libgloss: fix more missing dir with parallel install 2022-01-29 01:33:49 -05:00
m32r libgloss: merge m32r into top-level Makefile 2024-01-19 20:26:52 -05:00
m68hc11 libgloss: fix more missing dir with parallel install 2022-01-29 01:33:49 -05:00
m68k libgloss: fix up incorrect "it's" 2024-01-03 00:14:42 -05:00
mcore libgloss: merge mcore into top-level Makefile 2024-01-19 20:26:52 -05:00
mep libgloss: fix more missing dir with parallel install 2022-01-29 01:33:49 -05:00
microblaze libgloss: microblaze: fix read and _write declarations 2024-05-14 14:28:02 -04:00
mips libgloss: merge mips configure script up a level 2022-02-17 20:36:41 -05:00
mn10200 libgloss: merge mn10200 into top-level Makefile 2024-01-19 20:26:52 -05:00
mn10300 libgloss: merge mn10300 into top-level Makefile 2024-01-19 20:26:52 -05:00
moxie libgloss: merge moxie into top-level Makefile 2024-01-03 03:44:26 -05:00
msp430 libgloss: merge msp430 into top-level Makefile 2024-01-19 20:21:05 -05:00
mt libgloss: fix more missing dir with parallel install 2022-01-29 01:33:49 -05:00
nds32 libgloss: merge nds32 into top-level Makefile 2024-01-19 20:26:52 -05:00
nios2 libgloss: merge nios2 into top-level Makefile 2023-01-12 05:26:57 -05:00
or1k or1k: Fix compiler warnings 2024-12-16 10:24:53 +01:00
pa libgloss: fix more missing dir with parallel install 2022-01-29 01:33:49 -05:00
pru libgloss: pru: Trim crt0-minrt.o 2024-01-23 09:49:02 +01:00
riscv libgloss: riscv: Fix envp parameter for main 2024-04-12 11:44:07 +02:00
rl78 libgloss: merge rl78 into top-level Makefile 2024-01-19 20:26:52 -05:00
rs6000 libgloss: rs6000: fix incorrect install dir for xil files 2022-12-19 20:19:31 -05:00
rx libgloss: merge rx into top-level Makefile 2024-01-19 20:26:52 -05:00
sh * arm/elf-redboot.ld, iq2000/sim.ld, m68hc11/sim-valid-m68hc11.ld, 2005-05-20 15:45:45 +00:00
sparc libgloss: merge sparc into top-level Makefile 2024-01-19 22:23:47 -05:00
sparc_leon libgloss: merge sparc_leon into top-level Makefile 2024-01-19 22:23:47 -05:00
spu libgloss: drop $(INCLUDES) when using $(AS) 2023-12-19 14:00:03 -05:00
testsuite libgloss: fix up incorrect "it's" 2024-01-03 00:14:42 -05:00
tic6x libgloss: merge tic6x into top-level Makefile 2024-01-19 22:23:47 -05:00
v850 libgloss: merge v850 into top-level Makefile 2024-01-03 03:47:59 -05:00
visium libgloss: merge visium into top-level Makefile 2024-01-19 20:26:52 -05:00
wince libgloss: merge wince configure script up a level 2022-02-17 20:35:32 -05:00
xstormy16 libgloss: merge xstormy16 into top-level Makefile 2024-01-19 20:26:52 -05:00
xtensa newlib: xtensa: remove sys/xtensa. use machine/xtensa 2024-09-02 22:16:59 +02:00
aclocal.m4 libgloss: switch to AM_PROG_AR 2022-02-25 23:07:20 -05:00
ChangeLog Deprecate newlib and winsup ChangeLog files 2016-01-28 11:15:33 +01:00
ChangeLog-2015 Deprecate newlib and winsup ChangeLog files 2016-01-28 11:15:33 +01:00
close.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
config.h.in libgloss: merge epiphany & libnosys & or1k configure scripts up a level 2022-02-01 21:53:22 -05:00
configure arc64: Add port for Synopsys DesignWare ARCv3 ISA 2024-08-21 15:32:22 -04:00
configure.ac arc64: Add port for Synopsys DesignWare ARCv3 ISA 2024-08-21 15:32:22 -04:00
debug.c libgloss: fix up incorrect "it's" 2024-01-03 00:14:42 -05:00
debug.h 2002-04-17 Joel Sherrill <joel@OARcorp.com> 2002-04-17 19:10:37 +00:00
fstat.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
getpid.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
glue.h Fix various c99/gcc-14 issues in generic libgloss code 2023-12-29 21:31:27 -07:00
isatty.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
kill.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
lseek.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
MAINTAINERS libgloss: start a MAINTAINERS file 2024-01-24 17:15:35 -05:00
Makefile.am arc64: Add port for Synopsys DesignWare ARCv3 ISA 2024-08-21 15:32:22 -04:00
Makefile.in arc64: Add port for Synopsys DesignWare ARCv3 ISA 2024-08-21 15:32:22 -04:00
open.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
print.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
putnum.c Fix various c99/gcc-14 issues in generic libgloss code 2023-12-29 21:31:27 -07:00
read.c libgloss: fix read and write prototype 2024-05-06 19:17:13 -04:00
README libgloss: have README point to the manual 2022-02-17 20:41:53 -05:00
sbrk.c Fix various c99/gcc-14 issues in generic libgloss code 2023-12-29 21:31:27 -07:00
stat.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
syscall.h 2007-11-06 Dave Brolley <brolley@redhat.com> 2007-11-06 23:07:06 +00:00
unlink.c Fix various c99/gcc-14 issues in generic libgloss code 2023-12-29 21:31:27 -07:00
write.c libgloss: fix read and write prototype 2024-05-06 19:17:13 -04:00

Libgloss is a library for all the details that usually get glossed over.
This library refers to things like startup code, and usually I/O support
for GCC and the C library.

For more details, see the manual under doc/.