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

View File

@ -2187,6 +2187,9 @@ extern void print_operand ();
extern void notice_update_cc (); extern void notice_update_cc ();
extern void finalize_pic (); extern void finalize_pic ();
extern void override_options (); 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)) #define SET_INSN_VOLATILE(INSN) bitmap_set_bit (uid_volatile, INSN_UID (INSN))
static bitmap uid_volatile; static bitmap uid_volatile;
int function_arg_regno_p ();
/* Forward declarations */ /* Forward declarations */
static int count_basic_blocks PROTO((rtx)); static int count_basic_blocks PROTO((rtx));
static rtx find_basic_blocks_1 PROTO((rtx, 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 "recog.h"
#include "reload.h" #include "reload.h"
extern int significand_size ();
/* Each optab contains info on how this target machine /* Each optab contains info on how this target machine
can perform a particular operation can perform a particular operation
for all sizes and kinds of operands. for all sizes and kinds of operands.

View File

@ -69,6 +69,7 @@ Boston, MA 02111-1307, USA. */
#endif #endif
#endif #endif
#include <setjmp.h> #include <setjmp.h>
#include <alloca.h>
/* Some systems like Linux don't declare rindex if _POSIX_SOURCE is declared, /* 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 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. /* Emulate vfork using just plain fork, for systems without a real vfork.
This function is in the public domain. */ This function is in the public domain. */
int fork ();
int int
vfork () vfork ()
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@
#include <sys/types.h> #include <sys/types.h>
extern void *malloc (), *realloc (); 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
#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, /* We'd like to take advantage of _doprnt if it's around, a la error.c,
but then we'd have no VA_SPRINTF. */ but then we'd have no VA_SPRINTF. */
#if HAVE_VPRINTF #if HAVE_VPRINTF
@ -434,6 +438,10 @@ void undefindex (), top_defindex (), gen_defindex ();
void define_user_command (); void define_user_command ();
void free_pending_notes (), output_pending_notes (); 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 **get_brace_args ();
char *expansion (); char *expansion ();
int array_len (); int array_len ();

View File

@ -22,6 +22,13 @@
#define MAXCOLS 100 /* remove this limit later @@ */ #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 * Output environments. This is a hack grafted onto existing