GNU bug report logs -
#78882
stty.c compilation error
Previous Next
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
Hi Bruno,
Bruno Haible via GNU coreutils Bug Reports <bug-coreutils <at> gnu.org>
writes:
> 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.
Good catch, I fixed something similar in git a few weeks ago [1]. From
the commit message:
The OpenBSD 'sed' command does not support '\n' to represent newlines in
sed expressions. This leads to the follow compiler error:
In file included from builtin/help.c:15:
./config-list.h:282:18: error: use of undeclared identifier 'n'
"gitcvs.dbUser",n "gitcvs.dbPass",
^
1 error generated.
gmake: *** [Makefile:2821: builtin/help.o] Error 1
Perhaps it is worth documenting somewhere? I think Autoconf's manual has
a section of shell portability gotchas.
Collin
[1] https://github.com/git/git/commit/db170e18262ed10e5e9b7f3cbca6a0ac43267b20
This bug report was last modified 22 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.