GNU bug report logs - #78882
stty.c compilation error

Previous Next

Package: coreutils;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Mon, 23 Jun 2025 21:15:04 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Bruno Haible <bruno <at> clisp.org>
Subject: bug#78882: closed (Re: bug#78882: stty.c compilation error)
Date: Mon, 23 Jun 2025 22:01:06 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#78882: stty.c compilation error

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 78882 <at> debbugs.gnu.org.

-- 
78882: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78882
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Bruno Haible <bruno <at> clisp.org>, 78882-done <at> debbugs.gnu.org
Cc: "H. Peter Anvin" <hpa <at> zytor.com>
Subject: Re: bug#78882: stty.c compilation error
Date: Mon, 23 Jun 2025 23:00:04 +0100
On 23/06/2025 22:14, Bruno Haible via GNU coreutils Bug Reports wrote:
> Hi,
> 
> The coreutils CI fails today on OpenBSD and Solaris. (The previous build,
> a week ago, succeeded.)

> With OpenBSD sed and Solaris sed:
> 
> $ echo 100 | sed -e 's/^.*$/#  ifdef B&\n      case B&: return &;\n#  endif/'
> #  ifdef B100n      case B100: return 100;n#  endif
> 
> The attached patch fixes it.

Applied.
Marking this as done.

thanks!

Padraig

[Message part 3 (message/rfc822, inline)]
From: Bruno Haible <bruno <at> clisp.org>
To: bug-coreutils <at> gnu.org
Cc: "H. Peter Anvin" <hpa <at> zytor.com>
Subject: stty.c compilation error
Date: Mon, 23 Jun 2025 23:14:05 +0200
[Message part 4 (text/plain, inline)]
Hi,

The coreutils CI fails today on OpenBSD and Solaris. (The previous build,
a week ago, succeeded.)

Compilation error on OpenBSD:

cc  -I. -I.. -I./lib  -Ilib -I../lib -Isrc -I../src -I/usr/local/include -Wall  -Wno-format-extra-args -Wno-implicit-const-int-float-conversion -Wno-tautological-constant-out-of-range-compare -g -O2 -MT src/stty.o -MD -MP -MF $depbase.Tpo -c -o src/stty.o ../src/stty.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../src/stty.c:2177:
src/speedlist.h:156:4: error: unterminated conditional directive
#  ifdef B4000000n      case 4000000: return B4000000;n#  endif
   ^
src/speedlist.h:155:4: error: unterminated conditional directive
#  ifdef B3500000n      case 3500000: return B3500000;n#  endif
   ^
...

Compilation error on Solaris 11.4:

gcc -m64  -I. -I.. -I./lib  -Ilib -I../lib -Isrc -I../src  -Wall -D_REENTRANT  -g -O2 -MT src/stty.o -MD -MP -MF $depbase.Tpo -c -o src/stty.o ../src/stty.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../src/stty.c:2177:
src/speedlist.h: In function ‘baud_to_value’:
src/speedlist.h:60:19: warning: extra tokens at end of #ifdef directive
   60 | #  ifdef B0n      case B0: return 0;n#  endif
      |                   ^~~~
src/speedlist.h:156: error: unterminated #ifdef
  156 | #  ifdef B4000000n      case 4000000: return B4000000;n#  endif
src/speedlist.h:155: error: unterminated #ifdef
...


It looks like the 'speedgen' script, added in commit
357fda90d15fd3f7dba61e1ab322b183a48d0081, produces this invalid C code.

With GNU sed:

$ echo 100 | sed -e 's/^.*$/#  ifdef B&\n      case B&: return &;\n#  endif/'
#  ifdef B100
      case B100: return 100;
#  endif

With OpenBSD sed and Solaris sed:

$ echo 100 | sed -e 's/^.*$/#  ifdef B&\n      case B&: return &;\n#  endif/'
#  ifdef B100n      case B100: return 100;n#  endif

The attached patch fixes it.


[0001-build-Fix-compilation-error-on-OpenBSD-and-Solaris.patch (text/x-patch, attachment)]

This bug report was last modified 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.