Subject: State of Structure Assignments
Date: Thu, 19 Mar 2020 09:22:50 -0600
From: Gregory Nutt <spudan...@gmail.com>
To: sdcc-de...@lists.sourceforge.net, dev@nuttx.apache.org
To: SDCC sdcc-devel List
Cc: NuttX dev list
Hi, all. I need to know the current state of structure assignments in SDCC.
I am the author of the NuttX operating system and we have long supported
SDCC for z80 and z180 platforms. The OS has grown substantially over
the years so that it is not the first choice for really resource
constrained platforms any more. But I am proud of the legacy of SDCC
support and want to continue that support into the future.
NuttX has since graduated to an Apache incubator project and I am no
long the "benevolent dictator"; nowadays I need negotiate changes. No
more banging my shoes on the table and demanding my way!
In order to work around the structure assignment limitation in the old
SDCC, I had a special configuration option for SDCC called
CONFIG_CAN_PASS_STRUCTS that conditioned the OS and made it possible to
compile using the older SDCC versions. There is a strong movement in
the Apache NuttX project to remove that setting because it causes some
obscure POSIX violations (and people think it is ugly). Removing that
option will break use of old SDCC version with the OS.
I have seen some references like
https://github.com/z88dk/z88dk/issues/1132 that say, "Now that sdcc
supports assigning structs,..." So is this correct? Does SDCC now
properly support structure assignments? How about things like the
Linux-like mallinfo():
struct mallinfo mallinfo(void);
Or the POSIX required sigqueue() function that passes a union:
int sigqueue(int pid, int signo, union sigval value);
It is likely that the special SDCC support will be removed. If the
current SDCC will support assignments and passing of structures and
unions as parameters or return values, then there is no serious problem
and can be handled with some updates to documentation. If not, then we
will lose all support for the z80 family. The z80 itself is not such a
viable platform for NuttX, but the z180 certainly is.
Please let me know so that I can provide proper advice or at least
assess the damage.
Greg