Fix runtime errors on 64-bit architectures (tested under MacOS Catalina).

* Ignoring implicit function declaration warnings resulted in pointers
   being clobbered to int type.
This commit is contained in:
Krystian Bacławski 2020-07-24 21:23:49 +02:00
parent eef13d1aba
commit 75a558d4cf
18 changed files with 58 additions and 3 deletions

View File

@ -27,6 +27,8 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "flags.h"
#include "expr.h"
extern void error (), error_with_decl ();
/* Baserel support. */
@ -367,7 +369,7 @@ amigaos_function_arg(CUMULATIVE_ARGS *cum, enum machine_mode mode,
return gen_rtx(REG, mode, cum->last_arg_reg);
}
else
return (struct rtx_def *)m68k_function_arg(cum, mode, type);
return m68k_function_arg(cum, mode, type);
}
/* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,

View File

@ -474,6 +474,7 @@ while (0)
/* Given that symbolic_operand(X), return TRUE if no special
base relative relocation is necessary */
int read_only_operand ();
#define LEGITIMATE_BASEREL_OPERAND_P(X) \
(flag_pic >= 3 && read_only_operand (X))
@ -498,6 +499,7 @@ while (0)
On the Amiga we use this to indicate if references to a symbol should be
absolute or base relative. */
int amigaos_put_in_text ();
#define ENCODE_SECTION_INFO(DECL) \
do \
{ \
@ -608,6 +610,7 @@ while (0)
/* Determine if the epilogue should be output as RTL.
Don't do it if preserving a4. */
int amigaos_restore_a4 ();
#undef USE_RETURN_INSN
#define USE_RETURN_INSN (use_return_insn () && ! amigaos_restore_a4 ())
@ -617,6 +620,7 @@ while (0)
ARGS is a valid machine specific attribute for DECL. The attributes
in ATTRIBUTES have previously been assigned to DECL. */
int valid_amigaos_decl_attribute ();
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
(valid_amigaos_decl_attribute ((DECL), (IDENTIFIER)))
@ -624,6 +628,7 @@ while (0)
ARGS is a valid machine specific attribute for TYPE. The attributes
in ATTRIBUTES have previously been assigned to TYPE. */
int valid_amigaos_type_attribute ();
#undef VALID_MACHINE_TYPE_ATTRIBUTE
#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
(valid_amigaos_type_attribute ((TYPE), (ATTRIBUTES), (IDENTIFIER), (ARGS)))
@ -662,6 +667,7 @@ struct amigaos_args
for a call to a function whose data type is FNTYPE.
For a library call, FNTYPE is 0. */
void amigaos_init_cumulative_args ();
#undef INIT_CUMULATIVE_ARGS
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
(amigaos_init_cumulative_args(&(CUM), (FNTYPE)))
@ -670,6 +676,7 @@ struct amigaos_args
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be available.) */
void amigaos_function_arg_advance ();
#undef FUNCTION_ARG_ADVANCE
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
(amigaos_function_arg_advance (&(CUM)))
@ -677,14 +684,16 @@ struct amigaos_args
/* A C expression that controls whether a function argument is passed
in a register, and which register. */
struct rtx_def *amigaos_function_arg ();
#undef FUNCTION_ARG
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
((struct rtx_def *)amigaos_function_arg (&(CUM), (MODE), (TYPE)))
(amigaos_function_arg (&(CUM), (MODE), (TYPE)))
/* A C expression whose value is zero if the attributes on TYPE1 and
TYPE2 are incompatible, one if they are compatible, and two if they
are nearly compatible (which causes a warning to be generated). */
int comp_amigaos_type_attributes ();
#undef COMP_TYPE_ATTRIBUTES
#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
(comp_amigaos_type_attributes ((TYPE1), (TYPE2)))
@ -741,6 +750,7 @@ struct rtx_def* gen_stack_cleanup_call ();
#undef TARGET_ALTERNATE_ALLOCATE_STACK
#define TARGET_ALTERNATE_ALLOCATE_STACK 1
void amigaos_alternate_allocate_stack ();
#define ALTERNATE_ALLOCATE_STACK(OPERANDS) \
do \
{ \

View File

@ -2187,6 +2187,9 @@ extern void print_operand ();
extern void notice_update_cc ();
extern void finalize_pic ();
extern void override_options ();
extern void m68k_init_cumulative_args (), m68k_function_arg_advance ();
extern struct rtx_def *m68k_function_arg ();
extern int comp_m68k_type_attributes (), valid_m68k_type_attribute ();
/*

View File

@ -273,6 +273,8 @@ static rtx label_value_list;
#define SET_INSN_VOLATILE(INSN) bitmap_set_bit (uid_volatile, INSN_UID (INSN))
static bitmap uid_volatile;
int function_arg_regno_p ();
/* Forward declarations */
static int count_basic_blocks PROTO((rtx));
static rtx find_basic_blocks_1 PROTO((rtx, rtx*));

View File

@ -36,6 +36,8 @@ Boston, MA 02111-1307, USA. */
#include "recog.h"
#include "reload.h"
extern int significand_size ();
/* Each optab contains info on how this target machine
can perform a particular operation
for all sizes and kinds of operands.

View File

@ -69,6 +69,7 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
#include <setjmp.h>
#include <alloca.h>
/* Some systems like Linux don't declare rindex if _POSIX_SOURCE is declared,
but it normally does declare it. This means that configure thinks we don't

View File

@ -1,6 +1,8 @@
/* Emulate vfork using just plain fork, for systems without a real vfork.
This function is in the public domain. */
int fork ();
int
vfork ()
{

View File

@ -25,6 +25,7 @@
# ifdef HAVE_MALLOC_H
# include <malloc.h>
# else
void *malloc();
void free ();
# endif
#endif

View File

@ -21,6 +21,9 @@
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#else
void *malloc ();
void free ();
#endif
#include <string.h>
#include <sys/types.h>

View File

@ -31,6 +31,7 @@
# ifdef HAVE_MALLOC_H
# include <malloc.h>
# else
void *malloc ();
void free ();
# endif
#endif

View File

@ -46,6 +46,9 @@
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#else
void *malloc ();
void free ();
#endif
#include "loadinfo.h"

View File

@ -25,6 +25,9 @@
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#else
void *malloc ();
void free ();
#endif
#if defined HAVE_UNISTD_H || defined _LIBC

View File

@ -44,10 +44,13 @@ char *alloca ();
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#else
void *bsearch ();
char *getenv ();
void qsort ();
# ifdef HAVE_MALLOC_H
# include <malloc.h>
# else
void *malloc ();
void free ();
# endif
#endif

View File

@ -22,6 +22,8 @@
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#else
void free ();
#endif
#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC

View File

@ -200,6 +200,8 @@ static char *posixly_correct;
#include <string.h>
#define my_index strchr
#else
size_t strlen ();
int strcmp (), strncmp ();
/* Avoid depending on library functions or files
whose names are inconsistent. */

View File

@ -30,7 +30,7 @@
#include <sys/types.h>
extern void *malloc (), *realloc ();
static void memory_error_and_abort ();
static void abort(), memory_error_and_abort ();
/* **************************************************************** */
/* */

View File

@ -50,6 +50,10 @@ char *alloca ();
# endif
#endif
void *malloc ();
void free (), qsort (), abort (), exit ();
int atoi ();
/* We'd like to take advantage of _doprnt if it's around, a la error.c,
but then we'd have no VA_SPRINTF. */
#if HAVE_VPRINTF
@ -434,6 +438,10 @@ void undefindex (), top_defindex (), gen_defindex ();
void define_user_command ();
void free_pending_notes (), output_pending_notes ();
int validate (), search_forward (), set_paragraph_indent (), self_delimiting (),
set_footnote_style ();
void end_multitable (), multitable_item ();
char **get_brace_args ();
char *expansion ();
int array_len ();

View File

@ -22,6 +22,13 @@
#define MAXCOLS 100 /* remove this limit later @@ */
void inhibit_output_flushing (), uninhibit_output_flushing (), insert (),
close_paragraph (), line_error (), init_paragraph (), error (),
cm_noindent (), exit (), warning (), flush_output ();
int setup_output_environment (), select_output_environment (),
setup_multitable_parameters ();
/*
* Output environments. This is a hack grafted onto existing