+2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
+ (__gnat_locate_exec): Check that HOST_EXECUTABLE_SUFFIX is not
+ empty before doing a string search for it.
+ * socket.c (ATTRIBUTE_UNUSED): Define.
+ (__gnat_disable_sigpipe): Add ATTRIBUTE_UNUSED on parameter.
+ * terminals.c (ATTRIBUTE_UNUSED): Move around.
+ (__gnat_setup_child_communication): Add ATTRIBUTE_UNUSED on
+ parameter.
+ (__gnat_send_header): Add ATTRIBUTE_UNUSED on parameters.
+
2018-10-09 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Rewrite
__gnat_get_executable_suffix_ptr (int *len, const char **value)
{
*value = HOST_EXECUTABLE_SUFFIX;
+
if (!*value)
*len = 0;
else
char *
__gnat_locate_exec (char *exec_name, char *path_val)
{
+ const unsigned int len = strlen (HOST_EXECUTABLE_SUFFIX);
char *ptr;
- if (!strstr (exec_name, HOST_EXECUTABLE_SUFFIX))
+
+ if (len > 0 && !strstr (exec_name, HOST_EXECUTABLE_SUFFIX))
{
- char *full_exec_name =
- (char *) alloca
- (strlen (exec_name) + strlen (HOST_EXECUTABLE_SUFFIX) + 1);
+ char *full_exec_name = (char *) alloca (strlen (exec_name) + len + 1);
strcpy (full_exec_name, exec_name);
strcat (full_exec_name, HOST_EXECUTABLE_SUFFIX);
/* This file provides a portable binding to the sockets API */
+#define ATTRIBUTE_UNUSED __attribute__((unused))
+
/* Ensure access to errno is thread safe. */
#define _REENTRANT
#define _THREAD_SAFE
/* Disable the sending of SIGPIPE for writes on a broken stream */
void
-__gnat_disable_sigpipe (int fd)
+__gnat_disable_sigpipe (int fd ATTRIBUTE_UNUSED)
{
#ifdef SO_NOSIGPIPE
int val = 1;
* *
****************************************************************************/
+#define ATTRIBUTE_UNUSED __attribute__((unused))
+
/* First all usupported platforms. Add stubs for exported routines. */
#if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \
|| defined (__ANDROID__) || defined (__PikeOS__) || defined(__DJGPP__)
-#define ATTRIBUTE_UNUSED __attribute__((unused))
-
void *
__gnat_new_tty (void)
{
__gnat_setup_child_communication
(pty_desc *desc,
char **new_argv,
- int Use_Pipes)
+ int Use_Pipes ATTRIBUTE_UNUSED)
{
int status;
int pid = getpid ();
/* __gnat_send_header - dummy function. this interface is only used on Windows */
void
-__gnat_send_header (pty_desc* desc, char header[5], int size, int *ret)
+__gnat_send_header (pty_desc* desc ATTRIBUTE_UNUSED,
+ char header[5] ATTRIBUTE_UNUSED,
+ int size ATTRIBUTE_UNUSED,
+ int *ret ATTRIBUTE_UNUSED)
{
*ret = 0;
}