From a1d3851bcd7404635a0e04846fac7f1561a6e286 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 17 Jul 2014 08:14:35 +0200 Subject: [multiple changes] 2014-07-17 Pascal Obry * s-os_lib.ads: Minor comment update. 2014-07-17 Tristan Gingold * sysdep.c: Add ATTRIBUTE_UNUSED to avoid warnings. Fix some indentation. * socket.c: Remove #warning to avoid warning. * expect.c: Indent some preprocessor directives to clarify nested if. Do not use wait.h on PikeOS. Add ATTRIBUTE_UNUSED to remove warnings. * env.c: Fix indentation. Port to PikeOS. * gsocket.h: Port to PikeOS. Remove #warning. * terminals.c: Port to PikeOS. Fix indentation of the stubs. Add ATTRIBUTE_UNUSED to stubs arguments. Fix return statement of stubbed __gnat_setup_parent_communication. * adaint.c: Port to PikeOS. Reindent some preprocessor directives to clarify nested if. Fix indentation. Add missing ATTRIBUTE_UNUSED. 2014-07-17 Robert Dewar * sem_attr.adb: Minor reformatting. From-SVN: r212717 --- gcc/ada/ChangeLog | 25 ++++++++++ gcc/ada/adaint.c | 45 +++++++++++------- gcc/ada/env.c | 11 +++-- gcc/ada/expect.c | 37 +++++++++------ gcc/ada/gsocket.h | 7 +-- gcc/ada/s-os_lib.ads | 13 ++++-- gcc/ada/sem_attr.adb | 3 +- gcc/ada/socket.c | 4 +- gcc/ada/sysdep.c | 14 +++--- gcc/ada/terminals.c | 128 ++++++++++++++++++++++++++++++++++++++++++--------- 10 files changed, 210 insertions(+), 77 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e00a808..6d1c1b9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,28 @@ +2014-07-17 Pascal Obry + + * s-os_lib.ads: Minor comment update. + +2014-07-17 Tristan Gingold + + * sysdep.c: Add ATTRIBUTE_UNUSED to avoid warnings. Fix some + indentation. + * socket.c: Remove #warning to avoid warning. + * expect.c: Indent some preprocessor directives to clarify + nested if. Do not use wait.h on PikeOS. Add ATTRIBUTE_UNUSED + to remove warnings. + * env.c: Fix indentation. Port to PikeOS. + * gsocket.h: Port to PikeOS. Remove #warning. + * terminals.c: Port to PikeOS. Fix indentation of the stubs. + Add ATTRIBUTE_UNUSED to stubs arguments. Fix return statement + of stubbed __gnat_setup_parent_communication. + * adaint.c: Port to PikeOS. Reindent some preprocessor + directives to clarify nested if. Fix indentation. Add missing + ATTRIBUTE_UNUSED. + +2014-07-17 Robert Dewar + + * sem_attr.adb: Minor reformatting. + 2014-07-17 Robert Dewar * exp_ch7.adb, exp_ch7.ads, sinfo.ads: Minor reformatting. diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 151f2e6..a3829f7 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -73,6 +73,10 @@ #define HOST_OBJECT_SUFFIX ".obj" #endif +#ifdef __PikeOS__ +#define __BSD_VISIBLE 1 +#endif + #ifdef IN_RTS #include "tconfig.h" #include "tsystem.h" @@ -144,20 +148,20 @@ UINT CurrentCodePage; /* wait.h processing */ #ifdef __MINGW32__ -#if OLD_MINGW -#include -#endif +# if OLD_MINGW +# include +# endif #elif defined (__vxworks) && defined (__RTP__) -#include +# include #elif defined (__Lynx__) /* ??? We really need wait.h and it includes resource.h on Lynx. GCC has a resource.h header as well, included instead of the lynx version in our setup, causing lots of errors. We don't really need the lynx contents of this file, so just workaround the issue by preventing the inclusion of the GCC header from doing anything. */ -#define GCC_RESOURCE_H -#include -#elif defined (__nucleus__) +# define GCC_RESOURCE_H +# include +#elif defined (__nucleus__) || defined (__PikeOS__) /* No wait() or waitpid() calls available. */ #else /* Default case. */ @@ -506,7 +510,7 @@ __gnat_readlink (char *path ATTRIBUTE_UNUSED, size_t bufsiz ATTRIBUTE_UNUSED) { #if defined (_WIN32) || defined (VMS) \ - || defined(__vxworks) || defined (__nucleus__) + || defined(__vxworks) || defined (__nucleus__) || defined (__PikeOS__) return -1; #else return readlink (path, buf, bufsiz); @@ -522,7 +526,7 @@ __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED, char *newpath ATTRIBUTE_UNUSED) { #if defined (_WIN32) || defined (VMS) \ - || defined(__vxworks) || defined (__nucleus__) + || defined(__vxworks) || defined (__nucleus__) || defined (__PikeOS__) return -1; #else return symlink (oldpath, newpath); @@ -532,7 +536,7 @@ __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED, /* Try to lock a file, return 1 if success. */ #if defined (__vxworks) || defined (__nucleus__) \ - || defined (_WIN32) || defined (VMS) + || defined (_WIN32) || defined (VMS) || defined (__PikeOS__) /* Version that does not use link. */ @@ -2475,13 +2479,14 @@ __gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED) #endif int -__gnat_portable_spawn (char *args[]) +__gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED) { - int status = 0; + int status ATTRIBUTE_UNUSED = 0; int finished ATTRIBUTE_UNUSED; int pid ATTRIBUTE_UNUSED; -#if defined (__vxworks) || defined(__nucleus__) || defined(RTX) +#if defined (__vxworks) || defined(__nucleus__) || defined(RTX) \ + || defined(__PikeOS__) return -1; #elif defined (_WIN32) @@ -2551,12 +2556,15 @@ __gnat_dup (int oldfd) Return -1 if an error occurred. */ int -__gnat_dup2 (int oldfd, int newfd) +__gnat_dup2 (int oldfd ATTRIBUTE_UNUSED, int newfd ATTRIBUTE_UNUSED) { #if defined (__vxworks) && !defined (__RTP__) /* Not supported on VxWorks 5.x, but supported on VxWorks 6.0 when using RTPs. */ return -1; +#elif defined (__PikeOS__) + /* Not supported. */ + return -1; #elif defined (_WIN32) /* Special case when oldfd and newfd are identical and are the standard input, output or error as this makes Windows XP hangs. Note that we @@ -2809,10 +2817,12 @@ win32_wait (int *status) #endif int -__gnat_portable_no_block_spawn (char *args[]) +__gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED) { -#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) +#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) \ + || defined (__PikeOS__) + /* Not supported. */ return -1; #elif defined (_WIN32) @@ -2855,7 +2865,8 @@ __gnat_portable_wait (int *process_status) int status = 0; int pid = 0; -#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) +#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) \ + || defined (__PikeOS__) /* Not sure what to do here, so do nothing but return zero. */ #elif defined (_WIN32) diff --git a/gcc/ada/env.c b/gcc/ada/env.c index 800d207..de5e08a 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2005-2012, Free Software Foundation, Inc. * + * Copyright (C) 2005-2014, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -224,7 +224,8 @@ __gnat_environ (void) #endif } -void __gnat_unsetenv (char *name) { +void __gnat_unsetenv (char *name) +{ #if defined (VMS) /* Not implemented */ return; @@ -282,12 +283,14 @@ void __gnat_unsetenv (char *name) { #endif } -void __gnat_clearenv (void) { +void __gnat_clearenv (void) +{ #if defined (VMS) /* not implemented */ return; #elif defined (sun) \ - || (defined (__vxworks) && ! defined (__RTP__)) || defined (__Lynx__) + || (defined (__vxworks) && ! defined (__RTP__)) || defined (__Lynx__) \ + || defined (__PikeOS__) /* On Solaris, VxWorks (not RTPs), and Lynx there is no system call to unset a variable or to clear the environment so set all the entries in the environ table to NULL (see comment in diff --git a/gcc/ada/expect.c b/gcc/ada/expect.c index a40ffa3..aa014a6 100644 --- a/gcc/ada/expect.c +++ b/gcc/ada/expect.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2001-2011, AdaCore * + * Copyright (C) 2001-2014, AdaCore * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -45,17 +45,17 @@ #include #ifdef __MINGW32__ -#if OLD_MINGW -#include -#endif +# if OLD_MINGW +# include +# endif #elif defined (__vxworks) && defined (__RTP__) -#include +# include #elif defined (__Lynx__) -/* ??? See comment in adaint.c. */ -#define GCC_RESOURCE_H -#include -#elif defined (__nucleus__) -/* No wait.h available on Nucleus */ + /* ??? See comment in adaint.c. */ +# define GCC_RESOURCE_H +# include +#elif defined (__nucleus__) || defined (__PikeOS__) + /* No wait.h available on Nucleus */ #else #include #endif @@ -476,18 +476,20 @@ __gnat_expect_poll (int *fd, int num_fd, int timeout, int *is_set) #else void -__gnat_kill (int pid, int sig, int close) +__gnat_kill (int pid ATTRIBUTE_UNUSED, + int sig ATTRIBUTE_UNUSED, + int close ATTRIBUTE_UNUSED) { } int -__gnat_waitpid (int pid, int sig) +__gnat_waitpid (int pid ATTRIBUTE_UNUSED, int sig ATTRIBUTE_UNUSED) { return 0; } int -__gnat_pipe (int *fd) +__gnat_pipe (int *fd ATTRIBUTE_UNUSED) { return -1; } @@ -499,13 +501,18 @@ __gnat_expect_fork (void) } void -__gnat_expect_portable_execvp (int *pid, char *cmd, char *argv[]) +__gnat_expect_portable_execvp (int *pid ATTRIBUTE_UNUSED, + char *cmd ATTRIBUTE_UNUSED, + char *argv[] ATTRIBUTE_UNUSED) { *pid = 0; } int -__gnat_expect_poll (int *fd, int num_fd, int timeout, int *is_set) +__gnat_expect_poll (int *fd ATTRIBUTE_UNUSED, + int num_fd ATTRIBUTE_UNUSED, + int timeout ATTRIBUTE_UNUSED, + int *is_set ATTRIBUTE_UNUSED) { return -1; } diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h index e21d714..f139d72 100644 --- a/gcc/ada/gsocket.h +++ b/gcc/ada/gsocket.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 2004-2012, Free Software Foundation, Inc. * + * Copyright (C) 2004-2014, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -29,9 +29,10 @@ * * ****************************************************************************/ -#if defined(__nucleus__) || defined(VTHREADS) || defined(__ANDROID__) +#if defined(__nucleus__) || defined(VTHREADS) || defined(__ANDROID__) \ + || defined(__PikeOS__) -#warning Sockets not supported on these platforms +/* Sockets not supported on these platforms. */ #undef HAVE_SOCKETS #else diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads index 41989d9..014f114 100644 --- a/gcc/ada/s-os_lib.ads +++ b/gcc/ada/s-os_lib.ads @@ -522,10 +522,6 @@ package System.OS_Lib is -- contains the name of the file to which it is linked. Symbolic links may -- span file systems and may refer to directories. - S_Owner : constant := 1; - S_Group : constant := 2; - S_Others : constant := 4; - procedure Set_Writable (Name : String); -- Change permissions on the named file to make it writable for its owner @@ -537,8 +533,15 @@ package System.OS_Lib is -- This renaming is provided for backwards compatibility with previous -- versions. The use of Set_Non_Writable is preferred (clearer name). + S_Owner : constant := 1; + S_Group : constant := 2; + S_Others : constant := 4; + -- Constants for use in Mode parameter to Set_Executable + procedure Set_Executable (Name : String; Mode : Positive := S_Owner); - -- Change permissions on the named file to make it executable for its owner + -- Change permissions on the file given by Name to make it executable + -- for its owner, group or others, according to the setting of Mode. + -- As indicated, the default if no Mode parameter is given is owner. procedure Set_Readable (Name : String); -- Change permissions on the named file to make it readable for its diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 2f685b6..1de265d 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -10687,8 +10687,7 @@ package body Sem_Attr is HB := Make_Attribute_Reference (Loc, - Prefix => - Duplicate_Subexpr (P, Name_Req => True), + Prefix => Duplicate_Subexpr (P, Name_Req => True), Attribute_Name => Name_Last, Expressions => Dims); diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index 18999b3..ab5368f 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2003-2012, Free Software Foundation, Inc. * + * Copyright (C) 2003-2014, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -689,6 +689,4 @@ __gnat_servent_s_proto (struct servent * s) return s->s_proto; } -#else -# warning Sockets are not supported on this platform #endif /* defined(HAVE_SOCKETS) */ diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 4c4ec49..43550cd 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2013, Free Software Foundation, Inc. * + * Copyright (C) 1992-2014, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -314,7 +314,7 @@ getc_immediate_common (FILE *stream, int *ch, int *end_of_file, int *avail, - int waiting) + int waiting ATTRIBUTE_UNUSED) { #if defined (linux) || defined (sun) \ || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \ @@ -785,9 +785,11 @@ extern void __gnat_localtime_tzoff (const time_t *, const int *, long *); void -__gnat_localtime_tzoff (const time_t *timer, const int *is_historic, long *off) +__gnat_localtime_tzoff (const time_t *timer ATTRIBUTE_UNUSED, + const int *is_historic ATTRIBUTE_UNUSED, + long *off ATTRIBUTE_UNUSED) { - struct tm tp; + struct tm tp ATTRIBUTE_UNUSED; /* AIX, HPUX, Sun Solaris */ #if defined (_AIX) || defined (__hpux__) || defined (sun) @@ -853,8 +855,8 @@ __gnat_localtime_tzoff (const time_t *timer, const int *is_historic, long *off) /* Darwin, Free BSD, Linux, where component tm_gmtoff is present in struct tm */ -#elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) ||\ - defined (__GLIBC__) +#elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) \ + || defined (__GLIBC__) { localtime_r (timer, &tp); *off = tp.tm_gmtoff; diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c index 8672ca3..a46e610 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2008-2013, AdaCore * + * Copyright (C) 2008-2014, AdaCore * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -31,27 +31,111 @@ /* First all usupported platforms. Add stubs for exported routines. */ -#if defined (VMS) || defined (__vxworks) || defined (__Lynx__) || \ - defined (__ANDROID__) - -void * __gnat_new_tty (void) { return (void*)0; } -char * __gnat_tty_name (void* t) { return (char*)0; } -int __gnat_interrupt_pid (int pid) { return -1; } -int __gnat_interrupt_process (void* desc) { return -1; } -int __gnat_setup_communication (void** desc) { return -1; } -void __gnat_setup_parent_communication - (void* d, int* i, int* o, int*e, int*p) { return -1; } -int __gnat_setup_child_communication - (void* d, char **n, int u) { return -1; } -int __gnat_terminate_process (void *desc) { return -1; } -int __gnat_tty_fd (void* t) { return -1; } -int __gnat_tty_supported (void) { return 0; } -int __gnat_tty_waitpid (void *desc) { return 1; } -void __gnat_close_tty (void* t) {} -void __gnat_free_process (void** process) {} -void __gnat_reset_tty (void* t) {} -void __gnat_send_header (void* d, char h[5], int s, int *r) {} -void __gnat_setup_winsize (void *desc, int rows, int columns) {} +#if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \ + || defined (__ANDROID__) || defined (__PikeOS__) + +#define ATTRIBUTE_UNUSED __attribute__((unused)) + +void * +__gnat_new_tty (void) +{ + return (void*)0; +} + +char * +__gnat_tty_name (void* t ATTRIBUTE_UNUSED) +{ + return (char*)0; +} + +int +__gnat_interrupt_pid (int pid ATTRIBUTE_UNUSED) +{ + return -1; +} + +int +__gnat_interrupt_process (void* desc ATTRIBUTE_UNUSED) +{ + return -1; +} + +int +__gnat_setup_communication (void** desc ATTRIBUTE_UNUSED) +{ + return -1; +} + +void +__gnat_setup_parent_communication (void *d ATTRIBUTE_UNUSED, + int *i ATTRIBUTE_UNUSED, + int *o ATTRIBUTE_UNUSED, + int *e ATTRIBUTE_UNUSED, + int *p ATTRIBUTE_UNUSED) +{ +} + +int +__gnat_setup_child_communication (void *d ATTRIBUTE_UNUSED, + char **n ATTRIBUTE_UNUSED, + int u ATTRIBUTE_UNUSED) +{ + return -1; +} + +int +__gnat_terminate_process (void *desc ATTRIBUTE_UNUSED) +{ + return -1; +} + +int +__gnat_tty_fd (void* t ATTRIBUTE_UNUSED) +{ + return -1; +} + +int +__gnat_tty_supported (void) +{ + return 0; +} + +int +__gnat_tty_waitpid (void *desc ATTRIBUTE_UNUSED) +{ + return 1; +} + +void +__gnat_close_tty (void* t ATTRIBUTE_UNUSED) +{ +} + +void +__gnat_free_process (void** process ATTRIBUTE_UNUSED) +{ +} + +void +__gnat_reset_tty (void* t ATTRIBUTE_UNUSED) +{ +} + +void +__gnat_send_header (void* d ATTRIBUTE_UNUSED, + char h[5] ATTRIBUTE_UNUSED, + int s ATTRIBUTE_UNUSED, + int *r ATTRIBUTE_UNUSED) +{ +} + +void +__gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, + int rows ATTRIBUTE_UNUSED, + int columns ATTRIBUTE_UNUSED) +{ +} /* For Windows platforms. */ -- cgit v1.1