public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Help with a hang in snprintf() for sh-elf
@ 2022-10-29 21:37 John Scott
  0 siblings, 0 replies; only message in thread
From: John Scott @ 2022-10-29 21:37 UTC (permalink / raw)
  To: crossgcc

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

Hi,

I'm the maintainer of gcc-sh-elf for Debian, and I'm curious why the
following program seems to hang with GCC 12, Newlib 3.3.0, and Binutils
2.37, running the program under the appropriate simulator from GDB:

$ cat test.c
#include <stdio.h>
int main(void) {
	snprintf(NULL, 0, "%lf", 1.0);
}

$ sh-elf-gcc test.c
$ sh-elf-run a.out
$ # hangs

Note that if the floating point number is changed to 0.0, the hang
doesn't happen anymore.

The recipe used to build this cross toolchain can be seen at
https://salsa.debian.org/electronics-team/toolchains/gcc-sh-elf/-/blob/latest/debian/rules

I ran into this hang running the Newlib test suite.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-29 21:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 21:37 Help with a hang in snprintf() for sh-elf John Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).