[Toybox] [PATCH] A "dc" implementation

Oliver Webb aquahobbyist at proton.me
Mon Sep 25 14:11:48 PDT 2023






Oliver Webb <aquahobbyist at proton.me>

Sent with Proton Mail secure email.

------- Original Message -------
On Monday, September 25th, 2023 at 7:44 AM, Rob Landley <rob at landley.net> wrote:


> On 9/20/23 01:41, Oliver Webb via Toybox wrote:
> 
> > I have made a implementation of the 'dc' command in toybox
> 
> 
> I thought about adding this to pending anyway (which is not a promise to
> eventually merge it), but it didn't build with gcc 8.3:

I do my compile tests with gcc 11.4 (The default one for Ubuntu)
And I don't do -Wextra or -Wpedantic normally 
(Gives a wall of warnings and isn't on by default). so this went
unnoticed by me

> toys/pending/dc.c:193:4: error: a label can only be part of a statement and a
> declaration is not a statement
> int i = TT.stacki;

The earliest version of gcc the Ubuntu repos offer is version 9.5,
So I tested with that. It does give that error (and another one)
but to make sure there wasn't any other stuff I was missing I also
build with -Wextra and -Wpedantic and ignored the warnings that were  from the other stuff.

I made another standalone patch for it, pretty simple fix by just
putting a extra ";" after some of the case statements. I'll make 
sure to do compile tests with older versions of gcc in the future

> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-A-dc-implentation-that-builds-with-gcc-9.patch
Type: text/x-patch
Size: 5316 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230925/e1b012bb/attachment.bin>


More information about the Toybox mailing list