mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
sim: cris: fix C tests with newer toolchains
Make sure we include unistd.h for getpid prototypes to fix build warnings/errors with newer compilers & C libraries. Doing that for close in openpf highlights these were using the wrong function -- need to use fclose on FILE*, not close. These tests pass again with a cris-elf toolchain.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2021-01-07 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* kill2.c: Include unistd.h.
|
||||||
|
* pipe1.c, sched1.c, sched2.c, sched3.c, sched4.c, sig5.c,
|
||||||
|
sig8.c: Likewise.
|
||||||
|
* openpf1.c (main): Change close to fclose.
|
||||||
|
* openpf2.c: Likewise.
|
||||||
|
|
||||||
2016-01-04 Mike Frysinger <vapier@gentoo.org>
|
2016-01-04 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* asm/opterr1.ms: Update expected output.
|
* asm/opterr1.ms: Update expected output.
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ int main (int argc, char *argv[])
|
|||||||
f = fopen (fnam, "rb");
|
f = fopen (fnam, "rb");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
abort ();
|
abort ();
|
||||||
close (f);
|
fclose (f);
|
||||||
|
|
||||||
/* Cover another execution path. */
|
/* Cover another execution path. */
|
||||||
if (fopen ("/nonexistent", "rb") != NULL
|
if (fopen ("/nonexistent", "rb") != NULL
|
||||||
|
@ -10,7 +10,7 @@ int main (int argc, char *argv[])
|
|||||||
FILE *f = fopen ("openpf2.c", "rb");
|
FILE *f = fopen ("openpf2.c", "rb");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
abort ();
|
abort ();
|
||||||
close (f);
|
fclose (f);
|
||||||
printf ("pass\n");
|
printf ("pass\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
kill (getpid (), SIGBUS);
|
kill (getpid (), SIGBUS);
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
signal (SIGALRM, SIG_IGN);
|
signal (SIGALRM, SIG_IGN);
|
||||||
|
Reference in New Issue
Block a user