diff --git a/.gitignore b/.gitignore index 5a783b30..17174342 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ ld64-* zPATCHES cctools-* libtapi* +build/* +*.xcuserstate +*.xcuserdatad +*/xcuserdata/* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..9d3ae16c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "libyaml"] + path = libyaml + url = https://github.com/yaml/libyaml/ diff --git a/CMakeLists.txt b/CMakeLists.txt index f223eea0..5cf0c00a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Top Level CMake file for XTOOLS. -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.9.6) if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "No build type selected, default to MinSizeRel") @@ -64,7 +64,10 @@ else() message(STATUS "*Top Level* NO LTO") endif() -if(XTOOLS_TAPI_PATH AND +if(XTOOLS_USE_TAPILITE) + option(XTOOLS_TAPI_SUPPORT "Support TAPI in ld64." ON) + message(STATUS "*Top Level* WITH TAPIlite") +elseif(XTOOLS_TAPI_PATH AND EXISTS ${XTOOLS_TAPI_PATH}/include/tapi AND EXISTS ${XTOOLS_TAPI_PATH}/lib/libtapi.dylib) configure_file( @@ -128,8 +131,13 @@ include_directories(BEFORE SYSTEM "${CMAKE_SOURCE_DIR}/macho-target-includes") include_directories(BEFORE SYSTEM "${CMAKE_BINARY_DIR}/include") include_directories(BEFORE SYSTEM "${CMAKE_BINARY_DIR}/host-includes") if(XTOOLS_TAPI_SUPPORT) - include_directories(BEFORE SYSTEM "${XTOOLS_TAPI_PATH}/include") - message(STATUS "*Top Level* including ${XTOOLS_TAPI_PATH}/include") + if(XTOOLS_USE_TAPILITE) + include_directories(BEFORE SYSTEM "${CMAKE_SOURCE_DIR}/tapilite/include") + message(STATUS "*Top Level* including ${CMAKE_SOURCE_DIR}/tapilite/include") + else() + include_directories(BEFORE SYSTEM "${XTOOLS_TAPI_PATH}/include") + message(STATUS "*Top Level* including ${XTOOLS_TAPI_PATH}/include") + endif() endif() if (EXISTS ${CMAKE_BINARY_DIR}/lib) @@ -160,6 +168,15 @@ if (NOT XTOOLS_HAS_MODERNXAR) COPYONLY) endif() +# build tapilite first, so ld64 can link against it +if(XTOOLS_USE_TAPILITE) + if(EXISTS ${XTOOLS_LIBYAML_PATH}/CMakeLists.txt) + add_subdirectory(${XTOOLS_LIBYAML_PATH}) + include_directories("${CMAKE_SOURCE_DIR}/libyaml/include") + endif () + add_subdirectory(tapilite) +endif() + # Evaluate first so that we find out about libprunetrie. if( EXISTS ${CMAKE_SOURCE_DIR}/ld64/CMakeLists.txt ) add_subdirectory(ld64) diff --git a/cctools/ar/append.c b/cctools/ar/append.c index 44be5c89..05683abe 100644 --- a/cctools/ar/append.c +++ b/cctools/ar/append.c @@ -84,9 +84,8 @@ static char rcsid[] = "$OpenBSD: append.c,v 1.2 1996/06/26 05:31:16 deraadt Exp * Append files to the archive - modifies original archive or creates * a new archive if named archive does not exist. */ -int -append(argv) - char **argv; +int +append (char **argv) { int afd, fd, eval; char *file; diff --git a/cctools/ar/ar.c b/cctools/ar/ar.c index 90ed5706..e5205298 100644 --- a/cctools/ar/ar.c +++ b/cctools/ar/ar.c @@ -107,10 +107,8 @@ extern char support_url[]; * functions. Some hacks that let us be backward compatible with 4.3 ar * option parsing and sanity checking. */ -int -main(argc, argv) - int argc; - char **argv; +int +main (int argc, char **argv) { int c, retval, verbose, run_ranlib, toc64; char *p; @@ -317,9 +315,8 @@ main(argc, argv) exit(EXIT_SUCCESS); } -static void -badoptions(arg) - char *arg; +static void +badoptions (char *arg) { warnx("illegal option combination for %s", arg); diff --git a/cctools/ar/archive.c b/cctools/ar/archive.c index 12bd0edb..e86de868 100644 --- a/cctools/ar/archive.c +++ b/cctools/ar/archive.c @@ -89,9 +89,8 @@ static char hb[sizeof(HDR) + 1]; /* real header */ int archive_opened_for_writing = 0; -int -open_archive(mode) - int mode; +int +open_archive (int mode) { int created, fd, nr, r; char buf[SARMAG]; @@ -207,9 +206,8 @@ open_archive(mode) return (fd); } -void -close_archive(fd) - int fd; +void +close_archive (int fd) { (void)close(fd); /* Implicit unlock. */ @@ -226,9 +224,8 @@ close_archive(fd) * get_arobj -- * read the archive header for this member */ -int -get_arobj(fd) - int fd; +int +get_arobj (int fd) { struct ar_hdr *hdr; int len, nr; @@ -295,9 +292,7 @@ static int already_written; * Write an archive member to a file. */ void -put_arobj(cfp, sb) - CF *cfp; - struct stat *sb; +put_arobj(CF *cfp, struct stat *sb) { unsigned int lname; char *name; @@ -401,9 +396,7 @@ put_arobj(cfp, sb) * have been ripped out long ago. */ void -copy_ar(cfp, size) - CF *cfp; - off_t size; +copy_ar(CF *cfp, off_t size) { static char pad = '\n'; off_t sz; @@ -445,9 +438,8 @@ copy_ar(cfp, size) * skip_arobj - * Skip over an object -- taking care to skip the pad bytes. */ -void -skip_arobj(fd) - int fd; +void +skip_arobj (int fd) { off_t len; diff --git a/cctools/ar/contents.c b/cctools/ar/contents.c index 83cec425..3fa70b51 100644 --- a/cctools/ar/contents.c +++ b/cctools/ar/contents.c @@ -86,9 +86,8 @@ static char rcsid[] = "$OpenBSD: contents.c,v 1.2 1996/06/26 05:31:19 deraadt Ex * Handles t[v] option - opens the archive and then reads headers, * skipping member contents. */ -int -contents(argv) - char **argv; +int +contents (char **argv) { int afd, all; struct tm *tp; diff --git a/cctools/ar/delete.c b/cctools/ar/delete.c index a9de2122..f8ddb1dc 100644 --- a/cctools/ar/delete.c +++ b/cctools/ar/delete.c @@ -83,9 +83,8 @@ static char rcsid[] = "$OpenBSD: delete.c,v 1.2 1996/06/26 05:31:19 deraadt Exp * delete -- * Deletes named members from the archive. */ -int -delete(argv) - char **argv; +int +delete (char **argv) { CF cf; off_t size; diff --git a/cctools/ar/extract.c b/cctools/ar/extract.c index 69775808..e4de5dac 100644 --- a/cctools/ar/extract.c +++ b/cctools/ar/extract.c @@ -88,9 +88,8 @@ static char rcsid[] = "$OpenBSD: extract.c,v 1.2 1996/06/26 05:31:20 deraadt Exp * members date otherwise date is time of extraction. Does not modify * archive. */ -int -extract(argv) - char **argv; +int +extract (char **argv) { char *file; int afd, all, eval, tfd; diff --git a/cctools/ar/misc.c b/cctools/ar/misc.c index b0ac04fd..fce78b0c 100644 --- a/cctools/ar/misc.c +++ b/cctools/ar/misc.c @@ -83,8 +83,8 @@ static char rcsid[] = "$OpenBSD: misc.c,v 1.2 1996/06/26 05:31:21 deraadt Exp $" char *tname = "temporary file"; /* temporary file "name" */ -int -tmp() +int +tmp (void) { extern char *envtmp; sigset_t set, oset; @@ -117,8 +117,7 @@ tmp() * does, remove it from the argument list. */ char * -files(argv) - char **argv; +files (char **argv) { char **list, *p; @@ -132,9 +131,8 @@ files(argv) return (NULL); } -void -orphans(argv) - char **argv; +void +orphans (char **argv) { for (; *argv; ++argv) @@ -142,17 +140,15 @@ orphans(argv) } char * -rname(path) - char *path; +rname (char *path) { char *ind; return ((ind = strrchr(path, '/')) ? ind + 1 : path); } -int -compare(dest) - char *dest; +int +compare (char *dest) { if (options & AR_TR) @@ -160,17 +156,16 @@ compare(dest) return (!strcmp(chdr.name, rname(dest))); } -void -badfmt() +void +badfmt (void) { errno = EFTYPE; err(1, "%s", archive); } -void -error(name) - char *name; +void +error (char *name) { err(1, "%s", name); diff --git a/cctools/ar/move.c b/cctools/ar/move.c index a4f30617..14aaaaf8 100644 --- a/cctools/ar/move.c +++ b/cctools/ar/move.c @@ -87,9 +87,8 @@ static char rcsid[] = "$OpenBSD: move.c,v 1.2 1996/06/26 05:31:21 deraadt Exp $" * option selected members go after 'posname'. If no options, members * are moved to end of archive. */ -int -move(argv) - char **argv; +int +move (char **argv) { CF cf; off_t size, tsize; diff --git a/cctools/ar/print.c b/cctools/ar/print.c index 0df39a28..32b4286b 100644 --- a/cctools/ar/print.c +++ b/cctools/ar/print.c @@ -81,9 +81,8 @@ static char rcsid[] = "$OpenBSD: print.c,v 1.2 1996/06/26 05:31:22 deraadt Exp $ * Prints archive members on stdout - if member names given only * print those members, otherwise print all members. */ -int -print(argv) - char **argv; +int +print (char **argv) { CF cf; int afd, all; diff --git a/cctools/ar/replace.c b/cctools/ar/replace.c index 3f11d3ff..915a568d 100644 --- a/cctools/ar/replace.c +++ b/cctools/ar/replace.c @@ -87,9 +87,8 @@ static char rcsid[] = "$OpenBSD: replace.c,v 1.2 1996/06/26 05:31:23 deraadt Exp * the key entry, based on the a, b and i options. If the u option * is specified, modification dates select for replacement. */ -int -replace(argv) - char **argv; +int +replace (char **argv) { char *file; int afd, curfd, errflg, exists, mods, sfd, tfd1, tfd2; diff --git a/cctools/as/CMakeLists.txt b/cctools/as/CMakeLists.txt index 16d7b76b..02734ff6 100644 --- a/cctools/as/CMakeLists.txt +++ b/cctools/as/CMakeLists.txt @@ -42,13 +42,13 @@ if(XTOOLS_C_HAS_WNODEPRECATED_FLAG) endif() add_executable(as-driver driver.c) -set_target_properties(as-driver PROPERTIES COMPILE_FLAGS "-Di486 -Di586 -Di686") +set_target_properties(as-driver PROPERTIES COMPILE_FLAGS "-Di486 -Di586 -Di686 -UPPC") target_link_libraries(as-driver stuff) set_target_properties(as-driver PROPERTIES OUTPUT_NAME as) install(TARGETS as-driver DESTINATION bin ) add_executable(i386-as ${X86_SRCS}) -set_target_properties(i386-as PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686") +set_target_properties(i386-as PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686 -UPPC") set_target_properties(i386-as PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/i386) set_target_properties(i386-as PROPERTIES OUTPUT_NAME as) target_link_libraries(i386-as stuff) @@ -59,13 +59,13 @@ install(TARGETS i386-as DESTINATION bin/i386) if(BUILD_TESTING) add_executable(test-x86 i386-check.c) - set_target_properties(test-x86 PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686") + set_target_properties(test-x86 PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686 -UPPC") set_target_properties(test-x86 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests) add_test(NAME check-x86-as COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/check-as $ i386 $) endif() add_executable(x8664-as ${X86_SRCS}) -set_target_properties(x8664-as PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686 -DARCH64") +set_target_properties(x8664-as PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686 -DARCH64 -UPPC") set_target_properties(x8664-as PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/x86_64) set_target_properties(x8664-as PROPERTIES OUTPUT_NAME as) target_link_libraries(x8664-as stuff) @@ -76,7 +76,7 @@ install(TARGETS x8664-as DESTINATION bin/x86_64) if(BUILD_TESTING) add_executable(test-x86_64 i386-check.c) - set_target_properties(test-x86_64 PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686 -DARCH64") + set_target_properties(test-x86_64 PROPERTIES COMPILE_FLAGS "-DI386 -Di486 -Di586 -Di686 -DARCH64 -UPPC") set_target_properties(test-x86_64 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests) add_test(NAME check-x86_86-as COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/check-as $ x86_64 $) endif() @@ -109,7 +109,7 @@ endif() install(TARGETS ppc64-as DESTINATION bin/ppc64) add_executable(arm-as ${ARM_SRCS}) -set_target_properties(arm-as PROPERTIES COMPILE_FLAGS "-DARM") +set_target_properties(arm-as PROPERTIES COMPILE_FLAGS "-DARM -UPPC") set_target_properties(arm-as PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/arm) set_target_properties(arm-as PROPERTIES OUTPUT_NAME as) target_link_libraries(arm-as stuff) diff --git a/cctools/as/app.c b/cctools/as/app.c index be2f63be..2f854253 100644 --- a/cctools/as/app.c +++ b/cctools/as/app.c @@ -516,8 +516,8 @@ FILE *fp) return -1; } -int -do_scrub_next_char_from_string() +int +do_scrub_next_char_from_string (void) { /* State 0: beginning of normal line 1: After first whitespace on normal line (flush more white) diff --git a/cctools/as/as.h b/cctools/as/as.h index 964bb62b..7b187994 100644 --- a/cctools/as/as.h +++ b/cctools/as/as.h @@ -51,9 +51,13 @@ extern char version_string[]; * asserts() from are DISabled when NDEBUG is defined and * asserts() from are ENabled when NDEBUG is undefined. * For speed NDEBUG is defined so assert()'s are left out. + * NDEBUG is also defined on the command line, though, so wrap it in a + * preprocessor conditional, to avoid -Wmacro-redefined. #undef NDEBUG */ -#define NDEBUG +#ifndef NDEBUG +# define NDEBUG +#endif /* * For speed SUSPECT is undefined. diff --git a/cctools/as/hash.c b/cctools/as/hash.c index 4eacfbea..a15b83cb 100644 --- a/cctools/as/hash.c +++ b/cctools/as/hash.c @@ -441,8 +441,8 @@ char command; /* Number 0:TABLES-1 of current hashed symbol table. */ int number; -int -main () +int +main (void) { void applicatee (); void destroy (); @@ -541,27 +541,22 @@ main () } char * -what (description) - char *description; +what (char *description) { printf (" %s : ", description); gets (answer); return xstrdup (answer); } -void -destroy (string, value) - char *string; - char *value; +void +destroy (char *string, char *value) { free (string); free (value); } -void -applicatee (string, value) - char *string; - char *value; +void +applicatee (char *string, char *value) { printf ("%.20s-%.20s\n", string, value); } @@ -569,8 +564,8 @@ applicatee (string, value) /* Determine number: what hash table to use. Also determine h: points to hash_control. */ -void -whattable () +void +whattable (void) { for (;;) { diff --git a/cctools/as/hppa-aux.c b/cctools/as/hppa-aux.c index 1ab2d9e1..19a927ac 100644 --- a/cctools/as/hppa-aux.c +++ b/cctools/as/hppa-aux.c @@ -45,8 +45,8 @@ static const int print_errors = 1; static int reg_name_search( char *name); -int pa_parse_number(s) - char **s; +int +pa_parse_number (char **s) { int num; char *name; @@ -500,9 +500,8 @@ char *s) return(FALSE); } -int need_89_opcode(insn,result) - struct pa_it *insn; - struct pa_89_fp_reg_struct *result; +int +need_89_opcode (struct pa_it *insn, struct pa_89_fp_reg_struct *result) { if ( result->L_R_select == 1 && !(insn->fpof1 == DBL && insn->fpof2 == DBL) ) return TRUE; @@ -510,10 +509,8 @@ int need_89_opcode(insn,result) return FALSE; } -int -pa_89_parse_number(s,result) - char **s; - struct pa_89_fp_reg_struct *result; +int +pa_89_parse_number (char **s, struct pa_89_fp_reg_struct *result) { int num; char *name; @@ -658,8 +655,8 @@ pa_89_parse_number(s,result) } -int pa_parse_fp_cmp_cond(s) - char **s; +int +pa_parse_fp_cmp_cond (char **s) { int cond,i; struct possibleS { @@ -845,8 +842,8 @@ int field_selector) return value; } -int pa_parse_nullif(s) - char **s; +int +pa_parse_nullif (char **s) { int nullif; @@ -867,8 +864,8 @@ int pa_parse_nullif(s) return nullif; } -int pa_parse_nonneg_cmpsub_cmpltr(s) - char **s; +int +pa_parse_nonneg_cmpsub_cmpltr (char **s) { int cmpltr; char *name; @@ -915,8 +912,8 @@ int pa_parse_nonneg_cmpsub_cmpltr(s) return cmpltr; } -int pa_parse_neg_cmpsub_cmpltr(s) - char **s; +int +pa_parse_neg_cmpsub_cmpltr (char **s) { int cmpltr; char *name; @@ -964,8 +961,8 @@ int pa_parse_neg_cmpsub_cmpltr(s) return cmpltr; } -int pa_parse_nonneg_add_cmpltr(s) - char **s; +int +pa_parse_nonneg_add_cmpltr (char **s) { int cmpltr; char *name; @@ -1010,8 +1007,8 @@ int pa_parse_nonneg_add_cmpltr(s) return cmpltr; } -int pa_parse_neg_add_cmpltr(s) - char **s; +int +pa_parse_neg_add_cmpltr (char **s) { int cmpltr; char *name; diff --git a/cctools/as/hppa-check.c b/cctools/as/hppa-check.c index d5bdec0d..8b25d1d0 100644 --- a/cctools/as/hppa-check.c +++ b/cctools/as/hppa-check.c @@ -117,8 +117,8 @@ char *fp_format_str[] = { "sgl", "dbl", "quad" }; /* * Traverse the opcode table, dumping out sample instructions. */ -void -main() +void +main (void) { int i; const char *arg; diff --git a/cctools/as/i386.c b/cctools/as/i386.c index e53d690a..54f8101e 100644 --- a/cctools/as/i386.c +++ b/cctools/as/i386.c @@ -574,9 +574,7 @@ void md_number_to_chars (char *buf, signed_expr_t val, int n) { #endif void -i386_align_code (fragP, count) - fragS *fragP; - int count; +i386_align_code (fragS *fragP, int count) { /* Various efficient no-op patterns for aligning code labels. Note: Don't try to assemble the instructions in the comments. @@ -681,43 +679,37 @@ i386_align_code (fragP, count) fragP->fr_var = count; } -static INLINE unsigned int -mode_from_disp_size (t) - unsigned int t; +static INLINE unsigned int +mode_from_disp_size (unsigned int t) { return (t & Disp8) ? 1 : (t & (Disp16 | Disp32 | Disp32S)) ? 2 : 0; } static INLINE int -fits_in_signed_byte (num) - offsetT num; +fits_in_signed_byte(offsetT num) { return (num >= -128) && (num <= 127); } static INLINE int -fits_in_unsigned_byte (num) - offsetT num; +fits_in_unsigned_byte(offsetT num) { return (num & 0xff) == num; } static INLINE int -fits_in_unsigned_word (num) - offsetT num; +fits_in_unsigned_word(offsetT num) { return (num & 0xffff) == num; } static INLINE int -fits_in_signed_word (num) - offsetT num; +fits_in_signed_word(offsetT num) { return (-32768 <= num) && (num <= 32767); } static INLINE int -fits_in_signed_long (num) - offsetT num ATTRIBUTE_UNUSED; +fits_in_signed_long(offsetT num ATTRIBUTE_UNUSED) { #if !defined(BFD64) return 1; @@ -733,8 +725,7 @@ fits_in_signed_long (num) #endif } /* fits_in_signed_long() */ static INLINE int -fits_in_unsigned_long (num) - offsetT num ATTRIBUTE_UNUSED; +fits_in_unsigned_long(offsetT num ATTRIBUTE_UNUSED) { #if !defined(BFD64) return 1; @@ -744,8 +735,7 @@ fits_in_unsigned_long (num) } /* fits_in_unsigned_long() */ static int -smallest_imm_type (num) - offsetT num; +smallest_imm_type(offsetT num) { if (cpu_arch_flags != (Cpu086 | Cpu186 | Cpu286 | Cpu386 | Cpu486 | CpuNo64)) { @@ -771,9 +761,7 @@ smallest_imm_type (num) } static offsetT -offset_in_range (val, size) - offsetT val; - int size; +offset_in_range(offsetT val, int size) { addressT mask; @@ -1030,8 +1018,8 @@ uintptr_t dummy) } #ifndef NeXT_MOD -uint32_t -i386_mach () +uint32_t +i386_mach (void) { if (!strcmp (default_arch, "x86_64")) return bfd_mach_x86_64; @@ -1042,8 +1030,8 @@ i386_mach () } #endif -void -md_begin () +void +md_begin (void) { const char *hash_err; @@ -1209,10 +1197,8 @@ static void pt PARAMS ((unsigned int)); static void pe PARAMS ((expressionS *)); static void ps PARAMS ((symbolS *)); -static void -pi (line, x) - char *line; - i386_insn *x; +static void +pi (char *line, i386_insn *x) { unsigned int i; @@ -1247,8 +1233,7 @@ pi (line, x) } static void -pte (t) - template *t; +pte(template *t) { unsigned int i; fprintf (stdout, " %d operands ", t->operands); @@ -1269,8 +1254,7 @@ pte (t) } static void -pe (e) - expressionS *e; +pe(expressionS *e) { fprintf (stdout, " operation %d\n", e->X_op); fprintf (stdout, " add_number %ld (%lx)\n", @@ -1290,8 +1274,7 @@ pe (e) } static void -ps (s) - symbolS *s; +ps(symbolS *s) { fprintf (stdout, "%s type %s%s", S_GET_NAME (s), @@ -1341,9 +1324,8 @@ static const type_names[] = { 0, "" } }; -static void -pt (t) - unsigned int t; +static void +pt (unsigned int t) { const struct type_name *ty; @@ -1359,12 +1341,8 @@ pt (t) static bfd_reloc_code_real_type reloc PARAMS ((int, int, int, bfd_reloc_code_real_type)); -static bfd_reloc_code_real_type -reloc (size, pcrel, sign, other) - int size; - int pcrel; - int sign; - bfd_reloc_code_real_type other; +static bfd_reloc_code_real_type +reloc (int size, int pcrel, int sign, bfd_reloc_code_real_type other) { if (other != NO_RELOC) return other; @@ -1433,8 +1411,7 @@ reloc (size, pcrel, sign, other) some cases we force the original symbol to be used. */ int -tc_i386_fix_adjustable (fixP) - fixS *fixP ATTRIBUTE_UNUSED; +tc_i386_fix_adjustable(fixS *fixP ATTRIBUTE_UNUSED) { #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (OUTPUT_FLAVOR != bfd_target_elf_flavour) @@ -1482,9 +1459,8 @@ tc_i386_fix_adjustable (fixP) static int intel_float_operand PARAMS ((const char *mnemonic)); -static int -intel_float_operand (mnemonic) - const char *mnemonic; +static int +intel_float_operand (const char *mnemonic) { /* Note that the value returned is meaningful only for opcodes with (memory) operands, hence the code here is free to improperly handle opcodes that @@ -1540,9 +1516,8 @@ intel_float_operand (mnemonic) machine dependent instruction. This function is supposed to emit the frags/bytes it assembles to. */ -void -md_assemble (line) - char *line; +void +md_assemble (char *line) { int j; char mnemonic[MAX_MNEM_SIZE]; @@ -1809,9 +1784,7 @@ md_assemble (line) } static char * -parse_insn (line, mnemonic) - char *line; - char *mnemonic; +parse_insn (char *line, char *mnemonic) { char *l = line; char *token_start = l; @@ -2008,9 +1981,7 @@ parse_insn (line, mnemonic) } static char * -parse_operands (l, mnemonic) - char *l; - const char *mnemonic; +parse_operands (char *l, const char *mnemonic) { char *token_start; @@ -2138,8 +2109,8 @@ parse_operands (l, mnemonic) return l; } -static void -swap_operands () +static void +swap_operands (void) { union i386_op temp_op; unsigned int temp_type; @@ -2182,8 +2153,8 @@ swap_operands () /* Try to ensure constant immediates are represented in the smallest opcode possible. */ -static void -optimize_imm () +static void +optimize_imm (void) { char guess_suffix = 0; int op; @@ -2290,8 +2261,8 @@ optimize_imm () } /* Try to use the smallest displacement type too. */ -static void -optimize_disp () +static void +optimize_disp (void) { int op; @@ -2344,8 +2315,8 @@ optimize_disp () } } -static int -match_template () +static int +match_template (void) { /* Points to template once we've found it. */ const template *t; @@ -2525,8 +2496,8 @@ match_template () return 1; } -static int -check_string () +static int +check_string (void) { int mem_op = (i.types[0] & AnyMem) ? 0 : 1; if ((i.tm.operand_types[mem_op] & EsSeg) != 0) @@ -2792,8 +2763,8 @@ check_byte_reg (void) return 1; } -static int -check_long_reg () +static int +check_long_reg (void) { int op; @@ -2843,8 +2814,8 @@ check_long_reg () return 1; } -static int -check_qword_reg () +static int +check_qword_reg (void) { int op; @@ -2875,8 +2846,8 @@ check_qword_reg () return 1; } -static int -check_word_reg () +static int +check_word_reg (void) { int op; for (op = i.operands; --op >= 0;) @@ -2916,8 +2887,8 @@ check_word_reg () return 1; } -static int -finalize_imm () +static int +finalize_imm (void) { unsigned int overlap0, overlap1, overlap2; @@ -2994,8 +2965,8 @@ finalize_imm () return 1; } -static int -process_operands () +static int +process_operands (void) { /* Default segment register this instruction will use for memory accesses. 0 means unknown. This is only for optimizing out @@ -3123,7 +3094,7 @@ process_operands () } static const seg_entry * -build_modrm_byte () +build_modrm_byte(void) { const seg_entry *default_seg = 0; @@ -3381,8 +3352,8 @@ build_modrm_byte () return default_seg; } -static void -output_branch () +static void +output_branch (void) { char *p; int code16; @@ -3497,8 +3468,8 @@ output_branch () } } -static void -output_jump () +static void +output_jump (void) { char *p; int size; @@ -3589,8 +3560,8 @@ output_jump () #endif } -static void -output_interseg_jump () +static void +output_interseg_jump (void) { char *p; int size; @@ -3668,8 +3639,8 @@ output_interseg_jump () md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2); } -static void -output_insn () +static void +output_insn (void) { fragS *insn_start_frag; offsetT insn_start_off; @@ -3810,9 +3781,7 @@ output_insn () } static void -output_disp (insn_start_frag, insn_start_off) - fragS *insn_start_frag; - offsetT insn_start_off; +output_disp(fragS *insn_start_frag, offsetT insn_start_off) { char *p; unsigned int n; @@ -3982,9 +3951,7 @@ output_disp (insn_start_frag, insn_start_off) } static void -output_imm (insn_start_frag, insn_start_off) - fragS *insn_start_frag; - offsetT insn_start_off; +output_imm(fragS *insn_start_frag, offsetT insn_start_off) { char *p; unsigned int n; @@ -4294,11 +4261,8 @@ static enum bfd_reloc_code_real got_reloc = NO_RELOC; #if !NeXT_MOD || ARCH64 void -x86_cons_fix_new (frag, off, len, exp) - fragS *frag; - unsigned int off; - unsigned int len; - expressionS *exp; +x86_cons_fix_new(fragS *frag, unsigned int off, unsigned int len, +expressionS *exp) { #ifdef NeXT_MOD bfd_reloc_code_real_type r = reloc (len, 0, 0, got_reloc); @@ -4320,9 +4284,7 @@ segT #else void #endif -x86_cons (exp, size) - expressionS *exp; - int size; +x86_cons(expressionS *exp, int size) { #ifdef NeXT_MOD segT segment; @@ -4410,9 +4372,8 @@ pe_directive_secrel (dummy) static int i386_immediate PARAMS ((char *)); -static int -i386_immediate (imm_start) - char *imm_start; +static int +i386_immediate (char *imm_start) { char *save_input_line_pointer; #ifndef LEX_AT @@ -4500,8 +4461,7 @@ i386_immediate (imm_start) static char *i386_scale PARAMS ((char *)); static char * -i386_scale (scale) - char *scale; +i386_scale (char *scale) { offsetT val; char *save = input_line_pointer; @@ -4544,10 +4504,8 @@ i386_scale (scale) static int i386_displacement PARAMS ((char *, char *)); -static int -i386_displacement (disp_start, disp_end) - char *disp_start; - char *disp_end; +static int +i386_displacement (char *disp_start, char *disp_end) { expressionS *exp; segT exp_seg = 0; @@ -4715,9 +4673,8 @@ static int i386_index_check PARAMS ((const char *)); /* Make sure the memory operand we've been dealt is valid. Return 1 on success, 0 on a failure. */ -static int -i386_index_check (operand_string) - const char *operand_string; +static int +i386_index_check (const char *operand_string) { int ok; #if INFER_ADDR_PREFIX @@ -4799,9 +4756,8 @@ i386_index_check (operand_string) /* Parse OPERAND_STRING into the i386_insn structure I. Returns non-zero on error. */ -static int -i386_operand (operand_string) - char *operand_string; +static int +i386_operand (char *operand_string) { const reg_entry *r; char *end_op; @@ -5409,11 +5365,8 @@ int md_long_jump_size = 5; const int md_reloc_size = 8; void -md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr; - addressT from_addr, to_addr; - fragS *frag ATTRIBUTE_UNUSED; - symbolS *to_symbol ATTRIBUTE_UNUSED; +md_create_short_jump(char *ptr, addressT from_addr, addressT to_addr, +fragS *frag ATTRIBUTE_UNUSED, symbolS *to_symbol ATTRIBUTE_UNUSED) { offsetT offset; @@ -5424,11 +5377,8 @@ md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) } void -md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr; - addressT from_addr, to_addr; - fragS *frag ATTRIBUTE_UNUSED; - symbolS *to_symbol ATTRIBUTE_UNUSED; +md_create_long_jump(char *ptr, addressT from_addr, addressT to_addr, +fragS *frag ATTRIBUTE_UNUSED, symbolS *to_symbol ATTRIBUTE_UNUSED) { offsetT offset; @@ -5641,10 +5591,7 @@ int nsect) returned, or NULL on OK. */ char * -md_atof (type, litP, sizeP) - int type; - char *litP; - int *sizeP; +md_atof (int type, char *litP, int *sizeP) { int prec; LITTLENUM_TYPE words[MAX_LITTLENUMS]; @@ -5690,8 +5637,7 @@ md_atof (type, litP, sizeP) char output_invalid_buf[8]; static char * -output_invalid (c) - int c; +output_invalid (int c) { if (ISPRINT (c)) sprintf (output_invalid_buf, "'%c'", c); @@ -5703,9 +5649,7 @@ output_invalid (c) /* REG_STRING starts *before* REGISTER_PREFIX. */ static const reg_entry * -parse_register (reg_string, end_op) - char *reg_string; - char **end_op; +parse_register(char *reg_string, char **end_op) { char *s = reg_string; char *p; @@ -5864,8 +5808,7 @@ md_parse_option (c, arg) } void -md_show_usage (stream) - FILE *stream; +md_show_usage(FILE *stream) { #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) fprintf (stream, _("\ @@ -5990,9 +5933,7 @@ md_undefined_symbol (name) /* Round up a section size to the appropriate boundary. */ valueT -md_section_align (segment, size) - segT segment ATTRIBUTE_UNUSED; - valueT size; +md_section_align(segT segment ATTRIBUTE_UNUSED, valueT size) { #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) if (OUTPUT_FLAVOR == bfd_target_aout_flavour) @@ -6042,8 +5983,7 @@ s_bss (ignore) #endif void -i386_validate_fix (fixp) - fixS *fixp; +i386_validate_fix(fixS *fixp) { if (fixp->fx_subsy && fixp->fx_subsy == GOT_symbol) { @@ -6558,9 +6498,7 @@ static int intel_e10_1 PARAMS ((void)); static int intel_e11 PARAMS ((void)); static int -i386_intel_operand (operand_string, got_a_float) - char *operand_string; - int got_a_float; +i386_intel_operand(char *operand_string, int got_a_float) { int ret; char *p; @@ -7320,8 +7258,7 @@ intel_e11 () /* Match the given token against cur_token. If they match, read the next token from the operand string. */ static int -intel_match_token (code) - int code; +intel_match_token(int code) { if (cur_token.code == code) { diff --git a/cctools/as/input-file.c b/cctools/as/input-file.c index f7ec6009..6903a09b 100644 --- a/cctools/as/input-file.c +++ b/cctools/as/input-file.c @@ -24,7 +24,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ * Note we don't need to #include the "as.h" file. No common coupling! */ -#define NDEBUG /* JF remove asserts */ +#ifndef NDEBUG +# define NDEBUG /* JF remove asserts */ +#endif #include #include diff --git a/cctools/as/obstack.c b/cctools/as/obstack.c index 1910d861..e8c14894 100644 --- a/cctools/as/obstack.c +++ b/cctools/as/obstack.c @@ -215,99 +215,86 @@ POINTER obj) /* The function names appear in parentheses in order to prevent the macro-definitions of the names from being expanded there. */ -POINTER (obstack_base) (obstack) - struct obstack *obstack; +POINTER ( +obstack_base) (struct obstack *obstack) { return obstack_base (obstack); } -POINTER (obstack_next_free) (obstack) - struct obstack *obstack; +POINTER ( +obstack_next_free) (struct obstack *obstack) { return obstack_next_free (obstack); } -int (obstack_object_size) (obstack) - struct obstack *obstack; +int ( +obstack_object_size) (struct obstack *obstack) { return obstack_object_size (obstack); } -int (obstack_room) (obstack) - struct obstack *obstack; +int ( +obstack_room) (struct obstack *obstack) { return obstack_room (obstack); } -void (obstack_grow) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; +void ( +obstack_grow) (struct obstack *obstack, POINTER pointer, int length) { obstack_grow (obstack, pointer, length); } -void (obstack_grow0) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; +void ( +obstack_grow0) (struct obstack *obstack, POINTER pointer, int length) { obstack_grow0 (obstack, pointer, length); } -void (obstack_1grow) (obstack, character) - struct obstack *obstack; - int character; +void ( +obstack_1grow) (struct obstack *obstack, int character) { obstack_1grow (obstack, character); } -void (obstack_blank) (obstack, length) - struct obstack *obstack; - int length; +void ( +obstack_blank) (struct obstack *obstack, int length) { obstack_blank (obstack, length); } -void (obstack_1grow_fast) (obstack, character) - struct obstack *obstack; - int character; +void ( +obstack_1grow_fast) (struct obstack *obstack, int character) { obstack_1grow_fast (obstack, character); } -void (obstack_blank_fast) (obstack, length) - struct obstack *obstack; - int length; +void ( +obstack_blank_fast) (struct obstack *obstack, int length) { obstack_blank_fast (obstack, length); } -POINTER (obstack_finish) (obstack) - struct obstack *obstack; +POINTER ( +obstack_finish) (struct obstack *obstack) { return obstack_finish (obstack); } -POINTER (obstack_alloc) (obstack, length) - struct obstack *obstack; - int length; +POINTER ( +obstack_alloc) (struct obstack *obstack, int length) { return obstack_alloc (obstack, length); } -POINTER (obstack_copy) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; +POINTER ( +obstack_copy) (struct obstack *obstack, POINTER pointer, int length) { return obstack_copy (obstack, pointer, length); } -POINTER (obstack_copy0) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; +POINTER ( +obstack_copy0) (struct obstack *obstack, POINTER pointer, int length) { return obstack_copy0 (obstack, pointer, length); } diff --git a/cctools/as/read.c b/cctools/as/read.c index 1e4222ef..2efae414 100644 --- a/cctools/as/read.c +++ b/cctools/as/read.c @@ -4997,9 +4997,8 @@ uintptr_t value) /* Handle the SUN sparc assembler .seg directive. .seg should only occur with either a ".text" or ".data" argument. Call .text or .data accordingly */ -void -s_seg (ignore) - int ignore; +void +s_seg (int ignore) { pseudo_typeS *ps_t; char s[32]; diff --git a/cctools/as/sparc.c b/cctools/as/sparc.c index 0d94c1e2..dd9a3c4d 100644 --- a/cctools/as/sparc.c +++ b/cctools/as/sparc.c @@ -206,8 +206,8 @@ uintptr_t ignore) /* This function is called once, at assembler startup time. It should set up all the tables, etc. that the MD part of the assembler will need. */ -void -md_begin () +void +md_begin (void) { register const char *retval = NULL; int lose = 0; @@ -257,9 +257,8 @@ void) return; } -void -md_assemble (str) - char *str; +void +md_assemble (char *str) { char *toP; int rsd; @@ -338,9 +337,8 @@ md_assemble (str) } } -static void -sparc_ip (str) - char *str; +static void +sparc_ip (char *str) { char *error_message = ""; char *s; @@ -1016,9 +1014,8 @@ sparc_ip (str) the_insn.opcode = opcode; } -static int -getExpression (str) - char *str; +static int +getExpression (char *str) { char *save_in; segT seg; @@ -1057,10 +1054,7 @@ getExpression (str) #define MAX_LITTLENUMS 6 char * -md_atof (type, litP, sizeP) - char type; - char *litP; - int *sizeP; +md_atof (int type, char *litP, int *sizeP) { int prec; LITTLENUM_TYPE words[MAX_LITTLENUMS]; @@ -1249,10 +1243,7 @@ md_number_to_imm(unsigned char *buf, signed_expr_t val, int size, fixS *fixP, in */ int -md_parse_option (argP, cntP, vecP) - char **argP; - int *cntP; - char ***vecP; +md_parse_option (char **argP, int *cntP, char ***vecP) { char *p; const char **arch; @@ -1342,9 +1333,8 @@ S_GET_NAME(sym) } /* for debugging only */ -static void -print_insn (insn) - struct sparc_it *insn; +static void +print_insn (struct sparc_it *insn) { const char *const Reloc[] = { "VANILLA", diff --git a/cctools/as/write_object.c b/cctools/as/write_object.c index a751daee..5204916a 100644 --- a/cctools/as/write_object.c +++ b/cctools/as/write_object.c @@ -757,9 +757,8 @@ symbolP = symbol_find_or_make(isymbolP->isy_name); * Some stabs (e.g. SLINE) when found within a BINCL/EINCL disqualify the EXCL * optimization and therefore disable this checksumming. */ -static -void -set_BINCL_checksums() +static void +set_BINCL_checksums (void) { struct HeaderRange { symbolS* bincl; diff --git a/cctools/cbtlibs/CMakeLists.txt b/cctools/cbtlibs/CMakeLists.txt index 77cc8f8c..f9eac32c 100644 --- a/cctools/cbtlibs/CMakeLists.txt +++ b/cctools/cbtlibs/CMakeLists.txt @@ -11,3 +11,4 @@ add_library(syminfo libsyminfo.c) if(XTOOLS_C_HAS_FNOCOMMON_FLAG) set_target_properties(syminfo PROPERTIES COMPILE_FLAGS "-fno-common") endif() +target_link_libraries(syminfo stuff) diff --git a/cctools/gprof/calls.c b/cctools/gprof/calls.c index 7a22dfdb..c073a26e 100644 --- a/cctools/gprof/calls.c +++ b/cctools/gprof/calls.c @@ -180,10 +180,8 @@ operandname( mode ) /* NOTREACHED */ } -static -uint32_t -operandlength( modep ) - struct modebyte *modep; +static uint32_t +operandlength (struct modebyte *modep) { switch ( operandmode( modep ) ) { @@ -217,10 +215,8 @@ operandlength( modep ) /* NOTREACHED */ } -static -uint32_t -reladdr( modep ) - struct modebyte *modep; +static uint32_t +reladdr (struct modebyte *modep) { operandenum mode = operandmode( modep ); char *cp; diff --git a/cctools/ld/pass1.c b/cctools/ld/pass1.c index 408f7666..1d58fcc8 100644 --- a/cctools/ld/pass1.c +++ b/cctools/ld/pass1.c @@ -1752,47 +1752,6 @@ enum bool force_weak) } } -/* - * get_toc_byte_sex() guesses the byte sex of the table of contents of the - * library mapped in at the address, addr, of size, size based on the first - * object file's bytesex. If it can't figure it out, because the library has - * no object file members or is malformed it will return UNKNOWN_BYTE_SEX. - */ -__private_extern__ -enum byte_sex -get_toc_byte_sex( -char *addr, -uint32_t size) -{ - uint32_t magic; - uint32_t ar_name_size; - struct ar_hdr *ar_hdr; - char *p; - - ar_hdr = (struct ar_hdr *)(addr + SARMAG); - - p = addr + SARMAG + sizeof(struct ar_hdr) + - rnd(strtoul(ar_hdr->ar_size, NULL, 10), sizeof(short)); - while(p + sizeof(struct ar_hdr) + sizeof(uint32_t) < addr + size){ - ar_hdr = (struct ar_hdr *)p; - if(strncmp(ar_hdr->ar_name, AR_EFMT1, sizeof(AR_EFMT1) - 1) == 0) - ar_name_size = strtoul(ar_hdr->ar_name + sizeof(AR_EFMT1) - 1, - NULL, 10); - else - ar_name_size = 0; - p += sizeof(struct ar_hdr); - memcpy(&magic, p + ar_name_size, sizeof(uint32_t)); - if(magic == MH_MAGIC || magic == MH_MAGIC_64) - return(get_host_byte_sex()); - else if(magic == SWAP_INT(MH_MAGIC) || - magic == SWAP_INT(MH_MAGIC_64)) - return(get_host_byte_sex() == BIG_ENDIAN_BYTE_SEX ? - LITTLE_ENDIAN_BYTE_SEX : BIG_ENDIAN_BYTE_SEX); - p += rnd(strtoul(ar_hdr->ar_size, NULL, 10), sizeof(short)); - } - return(UNKNOWN_BYTE_SEX); -} - /* * check_archive_arch() check the archive specified to see if it's architecture * does not match that of whats being loaded and if so returns FALSE. Else it diff --git a/cctools/misc/indr.c b/cctools/misc/indr.c index d03e5202..b2cd5490 100644 --- a/cctools/misc/indr.c +++ b/cctools/misc/indr.c @@ -384,9 +384,8 @@ char *envp[]) /* * Print the current usage message and exit non-zero. */ -static -void -usage() +static void +usage (void) { fprintf(stderr, "Usage: %s [-n] [[-arch arch_flag] ...] " " \n", progname); @@ -1794,9 +1793,8 @@ struct list *list) * first 4 bytes are not stuffed with the size because on a little endian * machine that first byte is likely to be non-zero. */ -static -void -start_string_table() +static void +start_string_table (void) { if(string_table.size == 0){ string_table.size = INITIAL_STRING_TABLE_SIZE; @@ -1833,9 +1831,8 @@ char *p) * This routine is called after all calls to add_to_string_table() are made * to round off the size of the string table. It zeros the rounded bytes. */ -static -void -end_string_table() +static void +end_string_table (void) { uint32_t length; diff --git a/cctools/otool/arm_disasm.c b/cctools/otool/arm_disasm.c index 8a2ea5d9..66f26ce8 100644 --- a/cctools/otool/arm_disasm.c +++ b/cctools/otool/arm_disasm.c @@ -64,7 +64,7 @@ typedef char bfd_byte; /* HACKS to avoid pulling in all of FSF binutils include/dis-asm.h */ typedef int (*fprintf_ftype) (void *, const char*, ...); -struct disassemble_info { /* HACK'ed up for just what we need here */ +static struct disassemble_info { /* HACK'ed up for just what we need here */ fprintf_ftype fprintf_func; void *stream; diff --git a/cctools/otool/i386_disasm.c b/cctools/otool/i386_disasm.c index 0b60eb81..4bafbb35 100644 --- a/cctools/otool/i386_disasm.c +++ b/cctools/otool/i386_disasm.c @@ -1617,7 +1617,7 @@ static unsigned int xmm_rm(int r_m, int rex) /* * This is passed to the llvm disassembler. */ -struct disassemble_info { +static struct disassemble_info { enum bool verbose; /* Relocation information. */ struct relocation_info *sorted_relocs; diff --git a/cctools/otool/print_objc.c b/cctools/otool/print_objc.c index e8253f40..3793c226 100644 --- a/cctools/otool/print_objc.c +++ b/cctools/otool/print_objc.c @@ -75,6 +75,14 @@ struct objc_class_t { uint32_t protocols; /* struct objc_protocol_list * (32-bit pointer) */ }; +#ifndef CLS_GETINFO +# define CLS_GETINFO(cls, infomask) ((cls)->info & (infomask)) +// class is not a metaclass +#define CLS_CLASS 0x1 +// class is a metaclass +#define CLS_META 0x2 +#endif + struct objc_category_t { uint32_t category_name; /* char * (32-bit pointer) */ uint32_t class_name; /* char * (32-bit pointer) */ diff --git a/cctools/otool/sparc_disasm.c b/cctools/otool/sparc_disasm.c index 0a1e2972..b5c4acc0 100644 --- a/cctools/otool/sparc_disasm.c +++ b/cctools/otool/sparc_disasm.c @@ -153,14 +153,12 @@ union sparc_insn strings_size, verbose) static int opcodes_sorted = 0; -extern void qsort(); -static int compare_opcodes (); +static int compare_opcodes(char *, char *); #ifdef NOT_USED /* Nonzero if INSN is the opcode for a delayed branch. */ -static int -is_delayed_branch (insn) - union sparc_insn insn; +static int +is_delayed_branch (union sparc_insn insn) { unsigned int i; @@ -808,8 +806,7 @@ enum bool verbose) /* Compare opcodes A and B. */ static int -compare_opcodes (a, b) - char *a, *b; +compare_opcodes (char *a, char *b) { struct sparc_opcode *op0 = (struct sparc_opcode *) a; struct sparc_opcode *op1 = (struct sparc_opcode *) b; diff --git a/configure_cmd.sh b/configure_cmd.sh new file mode 100644 index 00000000..27139800 --- /dev/null +++ b/configure_cmd.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# To be run from a build subdirectory +# Hardcoded paths will probably need to be updated if anyone else wants to try using this + +/opt/local/libexec/cmake-bootstrap/bin/cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/opt/local/libexec/darwin-xtools" -DCMAKE_INSTALL_NAME_DIR="/opt/local/libexec/darwin-xtools/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/opt/local/libexec/darwin-xtools;/usr" -DCMAKE_C_COMPILER="/usr/bin/clang" -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib;/opt/local/libexec/darwin-xtools/lib" -Wno-dev -DCCTOOLS_LD_CLASSIC=OFF -DXTOOLS_LIBYAML_PATH=/Users/ericgallager/Documents/GitHub/darwin-xtools/libyaml -DXTOOLS_USE_TAPILITE=ON -DXTOOLS_HOST_IS_64B=ON -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="26.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk" .. diff --git a/dyld/dyld.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/dyld/dyld.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/dyld/dyld.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/dyld/src/dyldExceptions.c b/dyld/src/dyldExceptions.c index 487835e4..02a207a9 100644 --- a/dyld/src/dyldExceptions.c +++ b/dyld/src/dyldExceptions.c @@ -65,7 +65,8 @@ static pthread_key_t sCxaKey = 0; static char sPreMainCxaGlobals[2*sizeof(long)]; // called by libstdc++.a -char* __cxa_get_globals() +char * +__cxa_get_globals (void) { // if libSystem.dylib not yet initialized, or is old libSystem, use shared global if ( (_ZN4dyld17gLibSystemHelpersE == NULL) || (_ZN4dyld17gLibSystemHelpersE->version < 7) ) @@ -85,7 +86,8 @@ char* __cxa_get_globals() } // called by libstdc++.a -char* __cxa_get_globals_fast() +char * +__cxa_get_globals_fast (void) { // if libSystem.dylib not yet initialized, or is old libSystem, use shared global if ( (_ZN4dyld17gLibSystemHelpersE == NULL) || (_ZN4dyld17gLibSystemHelpersE->version < 7) ) @@ -175,7 +177,8 @@ void __Unwind_SjLj_SetThreadKey(pthread_key_t key) //} -struct _Unwind_FunctionContext* __Unwind_SjLj_GetTopOfFunctionStack() +struct _Unwind_FunctionContext * +__Unwind_SjLj_GetTopOfFunctionStack (void) { //_ZN4dyld3logEPKcz("__Unwind_SjLj_GetTopOfFunctionStack(), key=%d, ", sThreadChainKey); //printChain(); diff --git a/dyld/unit-tests/test-cases/DYLD_LIBRARY_PATH-dyld_env/foo.c b/dyld/unit-tests/test-cases/DYLD_LIBRARY_PATH-dyld_env/foo.c index 01c576d9..d1553269 100644 --- a/dyld/unit-tests/test-cases/DYLD_LIBRARY_PATH-dyld_env/foo.c +++ b/dyld/unit-tests/test-cases/DYLD_LIBRARY_PATH-dyld_env/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return RESULT; } diff --git a/dyld/unit-tests/test-cases/DYLD_VERSIONED_FRAMEWORK_PATH-basic/foo.c b/dyld/unit-tests/test-cases/DYLD_VERSIONED_FRAMEWORK_PATH-basic/foo.c index 01c576d9..d1553269 100644 --- a/dyld/unit-tests/test-cases/DYLD_VERSIONED_FRAMEWORK_PATH-basic/foo.c +++ b/dyld/unit-tests/test-cases/DYLD_VERSIONED_FRAMEWORK_PATH-basic/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return RESULT; } diff --git a/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-basic/foo.c b/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-basic/foo.c index 01c576d9..d1553269 100644 --- a/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-basic/foo.c +++ b/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-basic/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return RESULT; } diff --git a/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env-restrict/foo.c b/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env-restrict/foo.c index 01c576d9..d1553269 100644 --- a/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env-restrict/foo.c +++ b/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env-restrict/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return RESULT; } diff --git a/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env/foo.c b/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env/foo.c index 01c576d9..d1553269 100644 --- a/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env/foo.c +++ b/dyld/unit-tests/test-cases/DYLD_VERSIONED_LIBRARY_PATH-dyld_env/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return RESULT; } diff --git a/dyld/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c b/dyld/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c index bcb2bea3..59f10db2 100644 --- a/dyld/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c +++ b/dyld/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c @@ -29,7 +29,8 @@ /// rdar://problem/4058724 -int main() +int +main (void) { // NSAddImage is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/NSAddImage-RETURN_ONLY_IF_LOADED/main.c b/dyld/unit-tests/test-cases/NSAddImage-RETURN_ONLY_IF_LOADED/main.c index 3f84ea14..4446b67c 100644 --- a/dyld/unit-tests/test-cases/NSAddImage-RETURN_ONLY_IF_LOADED/main.c +++ b/dyld/unit-tests/test-cases/NSAddImage-RETURN_ONLY_IF_LOADED/main.c @@ -29,7 +29,8 @@ /// rdar://problem/3748251 -int main() +int +main (void) { // NSAddImage is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/NSAddImage-leafname/main.c b/dyld/unit-tests/test-cases/NSAddImage-leafname/main.c index f1ad6308..338d333d 100644 --- a/dyld/unit-tests/test-cases/NSAddImage-leafname/main.c +++ b/dyld/unit-tests/test-cases/NSAddImage-leafname/main.c @@ -29,7 +29,8 @@ /// rdar://problem/3751226 -int main() +int +main (void) { // NSAddImage is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/NSAddImage-leafname/zzz.c b/dyld/unit-tests/test-cases/NSAddImage-leafname/zzz.c index 80420c76..8fb4c55b 100644 --- a/dyld/unit-tests/test-cases/NSAddImage-leafname/zzz.c +++ b/dyld/unit-tests/test-cases/NSAddImage-leafname/zzz.c @@ -20,4 +20,5 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void zzz() {} +void +zzz (void) {} diff --git a/dyld/unit-tests/test-cases/NSAddressOfSymbol-NULL/main.c b/dyld/unit-tests/test-cases/NSAddressOfSymbol-NULL/main.c index 09fea733..316dbf5a 100644 --- a/dyld/unit-tests/test-cases/NSAddressOfSymbol-NULL/main.c +++ b/dyld/unit-tests/test-cases/NSAddressOfSymbol-NULL/main.c @@ -31,7 +31,8 @@ -int main() +int +main (void) { // NSAddressOfSymbol is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/absolute-symbol/foo.c b/dyld/unit-tests/test-cases/absolute-symbol/foo.c index 8d231e09..9d2171ae 100644 --- a/dyld/unit-tests/test-cases/absolute-symbol/foo.c +++ b/dyld/unit-tests/test-cases/absolute-symbol/foo.c @@ -1,5 +1,6 @@ int var = 5; -void func() { } +void +func (void) { } diff --git a/dyld/unit-tests/test-cases/addend/main.c b/dyld/unit-tests/test-cases/addend/main.c index 72b37102..3672ae75 100644 --- a/dyld/unit-tests/test-cases/addend/main.c +++ b/dyld/unit-tests/test-cases/addend/main.c @@ -46,7 +46,8 @@ const char* pd_12345678901234 = &d - 12345678901234; const char* pd12345678901234 = &d + 12345678901234; #endif -int main() +int +main (void) { if (*pc != 12 ) { FAIL("addend: *pc != 12"); diff --git a/dyld/unit-tests/test-cases/all_image_infos-cache-slide/main.c b/dyld/unit-tests/test-cases/all_image_infos-cache-slide/main.c index 0a550e45..823e658a 100644 --- a/dyld/unit-tests/test-cases/all_image_infos-cache-slide/main.c +++ b/dyld/unit-tests/test-cases/all_image_infos-cache-slide/main.c @@ -29,7 +29,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -static uintptr_t libSystemSlide() +static uintptr_t +libSystemSlide (void) { Dl_info info; if ( dladdr(&malloc, &info) == 0 ) { diff --git a/dyld/unit-tests/test-cases/all_image_infos-duplicate/foo.c b/dyld/unit-tests/test-cases/all_image_infos-duplicate/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/all_image_infos-duplicate/foo.c +++ b/dyld/unit-tests/test-cases/all_image_infos-duplicate/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/all_image_infos-duplicate/main.c b/dyld/unit-tests/test-cases/all_image_infos-duplicate/main.c index b70ac9ce..8bc37ff2 100644 --- a/dyld/unit-tests/test-cases/all_image_infos-duplicate/main.c +++ b/dyld/unit-tests/test-cases/all_image_infos-duplicate/main.c @@ -29,7 +29,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -struct dyld_all_image_infos* getImageInfosFromKernel() +struct dyld_all_image_infos * +getImageInfosFromKernel (void) { task_dyld_info_data_t task_dyld_info; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; diff --git a/dyld/unit-tests/test-cases/all_image_infos-paths/foo.c b/dyld/unit-tests/test-cases/all_image_infos-paths/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/all_image_infos-paths/foo.c +++ b/dyld/unit-tests/test-cases/all_image_infos-paths/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/all_image_infos-paths/main.c b/dyld/unit-tests/test-cases/all_image_infos-paths/main.c index 7e38b8c2..5d8d02fe 100644 --- a/dyld/unit-tests/test-cases/all_image_infos-paths/main.c +++ b/dyld/unit-tests/test-cases/all_image_infos-paths/main.c @@ -29,7 +29,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -struct dyld_all_image_infos* getImageInfosFromKernel() +struct dyld_all_image_infos * +getImageInfosFromKernel (void) { task_dyld_info_data_t task_dyld_info; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; diff --git a/dyld/unit-tests/test-cases/all_image_infos/foo.c b/dyld/unit-tests/test-cases/all_image_infos/foo.c index c1f5255b..0d5ba3d9 100644 --- a/dyld/unit-tests/test-cases/all_image_infos/foo.c +++ b/dyld/unit-tests/test-cases/all_image_infos/foo.c @@ -1,2 +1,3 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/all_image_infos/main.c b/dyld/unit-tests/test-cases/all_image_infos/main.c index efff2b89..dab1e1b4 100644 --- a/dyld/unit-tests/test-cases/all_image_infos/main.c +++ b/dyld/unit-tests/test-cases/all_image_infos/main.c @@ -32,7 +32,8 @@ extern struct mach_header __dso_handle; -struct dyld_all_image_infos* getImageInfosFromKernel() +struct dyld_all_image_infos * +getImageInfosFromKernel (void) { task_dyld_info_data_t task_dyld_info; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; @@ -45,8 +46,8 @@ struct dyld_all_image_infos* getImageInfosFromKernel() } -int -main() +int +main (void) { struct dyld_all_image_infos* infos = getImageInfosFromKernel(); if ( infos->version < 9 ) { diff --git a/dyld/unit-tests/test-cases/always-libSystem/main.c b/dyld/unit-tests/test-cases/always-libSystem/main.c index 56267838..c1c33743 100644 --- a/dyld/unit-tests/test-cases/always-libSystem/main.c +++ b/dyld/unit-tests/test-cases/always-libSystem/main.c @@ -31,7 +31,8 @@ // app crashes when libSystem cannot be found // -int main() +int +main (void) { // see if libSystem is in list of images uint32_t count = _dyld_image_count(); diff --git a/dyld/unit-tests/test-cases/big-jump-table/foo.c b/dyld/unit-tests/test-cases/big-jump-table/foo.c index c1a6c6c0..0b9c1fc3 100644 --- a/dyld/unit-tests/test-cases/big-jump-table/foo.c +++ b/dyld/unit-tests/test-cases/big-jump-table/foo.c @@ -1,827 +1,1652 @@ #include "foo.h" -void foo000() {} -void foo001() {} -void foo002() {} -void foo003() {} -void foo004() {} -void foo005() {} -void foo006() {} -void foo007() {} -void foo008() {} -void foo009() {} -void foo010() {} -void foo011() {} -void foo012() {} -void foo013() {} -void foo014() {} -void foo015() {} -void foo016() {} -void foo017() {} -void foo018() {} -void foo019() {} -void foo020() {} -void foo021() {} -void foo022() {} -void foo023() {} -void foo024() {} -void foo025() {} -void foo026() {} -void foo027() {} -void foo028() {} -void foo029() {} -void foo030() {} -void foo031() {} -void foo032() {} -void foo033() {} -void foo034() {} -void foo035() {} -void foo036() {} -void foo037() {} -void foo038() {} -void foo039() {} -void foo040() {} -void foo041() {} -void foo042() {} -void foo043() {} -void foo044() {} -void foo045() {} -void foo046() {} -void foo047() {} -void foo048() {} -void foo049() {} -void foo050() {} -void foo051() {} -void foo052() {} -void foo053() {} -void foo054() {} -void foo055() {} -void foo056() {} -void foo057() {} -void foo058() {} -void foo059() {} -void foo060() {} -void foo061() {} -void foo062() {} -void foo063() {} -void foo064() {} -void foo065() {} -void foo066() {} -void foo067() {} -void foo068() {} -void foo069() {} -void foo070() {} -void foo071() {} -void foo072() {} -void foo073() {} -void foo074() {} -void foo075() {} -void foo076() {} -void foo077() {} -void foo078() {} -void foo079() {} -void foo080() {} -void foo081() {} -void foo082() {} -void foo083() {} -void foo084() {} -void foo085() {} -void foo086() {} -void foo087() {} -void foo088() {} -void foo089() {} -void foo090() {} -void foo091() {} -void foo092() {} -void foo093() {} -void foo094() {} -void foo095() {} -void foo096() {} -void foo097() {} -void foo098() {} -void foo099() {} -void foo100() {} -void foo101() {} -void foo102() {} -void foo103() {} -void foo104() {} -void foo105() {} -void foo106() {} -void foo107() {} -void foo108() {} -void foo109() {} -void foo110() {} -void foo111() {} -void foo112() {} -void foo113() {} -void foo114() {} -void foo115() {} -void foo116() {} -void foo117() {} -void foo118() {} -void foo119() {} -void foo120() {} -void foo121() {} -void foo122() {} -void foo123() {} -void foo124() {} -void foo125() {} -void foo126() {} -void foo127() {} -void foo128() {} -void foo129() {} -void foo130() {} -void foo131() {} -void foo132() {} -void foo133() {} -void foo134() {} -void foo135() {} -void foo136() {} -void foo137() {} -void foo138() {} -void foo139() {} -void foo140() {} -void foo141() {} -void foo142() {} -void foo143() {} -void foo144() {} -void foo145() {} -void foo146() {} -void foo147() {} -void foo148() {} -void foo149() {} -void foo150() {} -void foo151() {} -void foo152() {} -void foo153() {} -void foo154() {} -void foo155() {} -void foo156() {} -void foo157() {} -void foo158() {} -void foo159() {} -void foo160() {} -void foo161() {} -void foo162() {} -void foo163() {} -void foo164() {} -void foo165() {} -void foo166() {} -void foo167() {} -void foo168() {} -void foo169() {} -void foo170() {} -void foo171() {} -void foo172() {} -void foo173() {} -void foo174() {} -void foo175() {} -void foo176() {} -void foo177() {} -void foo178() {} -void foo179() {} -void foo180() {} -void foo181() {} -void foo182() {} -void foo183() {} -void foo184() {} -void foo185() {} -void foo186() {} -void foo187() {} -void foo188() {} -void foo189() {} -void foo190() {} -void foo191() {} -void foo192() {} -void foo193() {} -void foo194() {} -void foo195() {} -void foo196() {} -void foo197() {} -void foo198() {} -void foo199() {} -void foo200() {} -void foo201() {} -void foo202() {} -void foo203() {} -void foo204() {} -void foo205() {} -void foo206() {} -void foo207() {} -void foo208() {} -void foo209() {} -void foo210() {} -void foo211() {} -void foo212() {} -void foo213() {} -void foo214() {} -void foo215() {} -void foo216() {} -void foo217() {} -void foo218() {} -void foo219() {} -void foo220() {} -void foo221() {} -void foo222() {} -void foo223() {} -void foo224() {} -void foo225() {} -void foo226() {} -void foo227() {} -void foo228() {} -void foo229() {} -void foo230() {} -void foo231() {} -void foo232() {} -void foo233() {} -void foo234() {} -void foo235() {} -void foo236() {} -void foo237() {} -void foo238() {} -void foo239() {} -void foo240() {} -void foo241() {} -void foo242() {} -void foo243() {} -void foo244() {} -void foo245() {} -void foo246() {} -void foo247() {} -void foo248() {} -void foo249() {} -void foo250() {} -void foo251() {} -void foo252() {} -void foo253() {} -void foo254() {} -void foo255() {} -void foo256() {} -void foo257() {} -void foo258() {} -void foo259() {} -void foo260() {} -void foo261() {} -void foo262() {} -void foo263() {} -void foo264() {} -void foo265() {} -void foo266() {} -void foo267() {} -void foo268() {} -void foo269() {} -void foo270() {} -void foo271() {} -void foo272() {} -void foo273() {} -void foo274() {} -void foo275() {} -void foo276() {} -void foo277() {} -void foo278() {} -void foo279() {} -void foo280() {} -void foo281() {} -void foo282() {} -void foo283() {} -void foo284() {} -void foo285() {} -void foo286() {} -void foo287() {} -void foo288() {} -void foo289() {} -void foo290() {} -void foo291() {} -void foo292() {} -void foo293() {} -void foo294() {} -void foo295() {} -void foo296() {} -void foo297() {} -void foo298() {} -void foo299() {} -void foo300() {} -void foo301() {} -void foo302() {} -void foo303() {} -void foo304() {} -void foo305() {} -void foo306() {} -void foo307() {} -void foo308() {} -void foo309() {} -void foo310() {} -void foo311() {} -void foo312() {} -void foo313() {} -void foo314() {} -void foo315() {} -void foo316() {} -void foo317() {} -void foo318() {} -void foo319() {} -void foo320() {} -void foo321() {} -void foo322() {} -void foo323() {} -void foo324() {} -void foo325() {} -void foo326() {} -void foo327() {} -void foo328() {} -void foo329() {} -void foo330() {} -void foo331() {} -void foo332() {} -void foo333() {} -void foo334() {} -void foo335() {} -void foo336() {} -void foo337() {} -void foo338() {} -void foo339() {} -void foo340() {} -void foo341() {} -void foo342() {} -void foo343() {} -void foo344() {} -void foo345() {} -void foo346() {} -void foo347() {} -void foo348() {} -void foo349() {} -void foo350() {} -void foo351() {} -void foo352() {} -void foo353() {} -void foo354() {} -void foo355() {} -void foo356() {} -void foo357() {} -void foo358() {} -void foo359() {} -void foo360() {} -void foo361() {} -void foo362() {} -void foo363() {} -void foo364() {} -void foo365() {} -void foo366() {} -void foo367() {} -void foo368() {} -void foo369() {} -void foo370() {} -void foo371() {} -void foo372() {} -void foo373() {} -void foo374() {} -void foo375() {} -void foo376() {} -void foo377() {} -void foo378() {} -void foo379() {} -void foo380() {} -void foo381() {} -void foo382() {} -void foo383() {} -void foo384() {} -void foo385() {} -void foo386() {} -void foo387() {} -void foo388() {} -void foo389() {} -void foo390() {} -void foo391() {} -void foo392() {} -void foo393() {} -void foo394() {} -void foo395() {} -void foo396() {} -void foo397() {} -void foo398() {} -void foo399() {} -void foo400() {} -void foo401() {} -void foo402() {} -void foo403() {} -void foo404() {} -void foo405() {} -void foo406() {} -void foo407() {} -void foo408() {} -void foo409() {} -void foo410() {} -void foo411() {} -void foo412() {} -void foo413() {} -void foo414() {} -void foo415() {} -void foo416() {} -void foo417() {} -void foo418() {} -void foo419() {} -void foo420() {} -void foo421() {} -void foo422() {} -void foo423() {} -void foo424() {} -void foo425() {} -void foo426() {} -void foo427() {} -void foo428() {} -void foo429() {} -void foo430() {} -void foo431() {} -void foo432() {} -void foo433() {} -void foo434() {} -void foo435() {} -void foo436() {} -void foo437() {} -void foo438() {} -void foo439() {} -void foo440() {} -void foo441() {} -void foo442() {} -void foo443() {} -void foo444() {} -void foo445() {} -void foo446() {} -void foo447() {} -void foo448() {} -void foo449() {} -void foo450() {} -void foo451() {} -void foo452() {} -void foo453() {} -void foo454() {} -void foo455() {} -void foo456() {} -void foo457() {} -void foo458() {} -void foo459() {} -void foo460() {} -void foo461() {} -void foo462() {} -void foo463() {} -void foo464() {} -void foo465() {} -void foo466() {} -void foo467() {} -void foo468() {} -void foo469() {} -void foo470() {} -void foo471() {} -void foo472() {} -void foo473() {} -void foo474() {} -void foo475() {} -void foo476() {} -void foo477() {} -void foo478() {} -void foo479() {} -void foo480() {} -void foo481() {} -void foo482() {} -void foo483() {} -void foo484() {} -void foo485() {} -void foo486() {} -void foo487() {} -void foo488() {} -void foo489() {} -void foo490() {} -void foo491() {} -void foo492() {} -void foo493() {} -void foo494() {} -void foo495() {} -void foo496() {} -void foo497() {} -void foo498() {} -void foo499() {} -void foo500() {} -void foo501() {} -void foo502() {} -void foo503() {} -void foo504() {} -void foo505() {} -void foo506() {} -void foo507() {} -void foo508() {} -void foo509() {} -void foo510() {} -void foo511() {} -void foo512() {} -void foo513() {} -void foo514() {} -void foo515() {} -void foo516() {} -void foo517() {} -void foo518() {} -void foo519() {} -void foo520() {} -void foo521() {} -void foo522() {} -void foo523() {} -void foo524() {} -void foo525() {} -void foo526() {} -void foo527() {} -void foo528() {} -void foo529() {} -void foo530() {} -void foo531() {} -void foo532() {} -void foo533() {} -void foo534() {} -void foo535() {} -void foo536() {} -void foo537() {} -void foo538() {} -void foo539() {} -void foo540() {} -void foo541() {} -void foo542() {} -void foo543() {} -void foo544() {} -void foo545() {} -void foo546() {} -void foo547() {} -void foo548() {} -void foo549() {} -void foo550() {} -void foo551() {} -void foo552() {} -void foo553() {} -void foo554() {} -void foo555() {} -void foo556() {} -void foo557() {} -void foo558() {} -void foo559() {} -void foo560() {} -void foo561() {} -void foo562() {} -void foo563() {} -void foo564() {} -void foo565() {} -void foo566() {} -void foo567() {} -void foo568() {} -void foo569() {} -void foo570() {} -void foo571() {} -void foo572() {} -void foo573() {} -void foo574() {} -void foo575() {} -void foo576() {} -void foo577() {} -void foo578() {} -void foo579() {} -void foo580() {} -void foo581() {} -void foo582() {} -void foo583() {} -void foo584() {} -void foo585() {} -void foo586() {} -void foo587() {} -void foo588() {} -void foo589() {} -void foo590() {} -void foo591() {} -void foo592() {} -void foo593() {} -void foo594() {} -void foo595() {} -void foo596() {} -void foo597() {} -void foo598() {} -void foo599() {} -void foo600() {} -void foo601() {} -void foo602() {} -void foo603() {} -void foo604() {} -void foo605() {} -void foo606() {} -void foo607() {} -void foo608() {} -void foo609() {} -void foo610() {} -void foo611() {} -void foo612() {} -void foo613() {} -void foo614() {} -void foo615() {} -void foo616() {} -void foo617() {} -void foo618() {} -void foo619() {} -void foo620() {} -void foo621() {} -void foo622() {} -void foo623() {} -void foo624() {} -void foo625() {} -void foo626() {} -void foo627() {} -void foo628() {} -void foo629() {} -void foo630() {} -void foo631() {} -void foo632() {} -void foo633() {} -void foo634() {} -void foo635() {} -void foo636() {} -void foo637() {} -void foo638() {} -void foo639() {} -void foo640() {} -void foo641() {} -void foo642() {} -void foo643() {} -void foo644() {} -void foo645() {} -void foo646() {} -void foo647() {} -void foo648() {} -void foo649() {} -void foo650() {} -void foo651() {} -void foo652() {} -void foo653() {} -void foo654() {} -void foo655() {} -void foo656() {} -void foo657() {} -void foo658() {} -void foo659() {} -void foo660() {} -void foo661() {} -void foo662() {} -void foo663() {} -void foo664() {} -void foo665() {} -void foo666() {} -void foo667() {} -void foo668() {} -void foo669() {} -void foo670() {} -void foo671() {} -void foo672() {} -void foo673() {} -void foo674() {} -void foo675() {} -void foo676() {} -void foo677() {} -void foo678() {} -void foo679() {} -void foo680() {} -void foo681() {} -void foo682() {} -void foo683() {} -void foo684() {} -void foo685() {} -void foo686() {} -void foo687() {} -void foo688() {} -void foo689() {} -void foo690() {} -void foo691() {} -void foo692() {} -void foo693() {} -void foo694() {} -void foo695() {} -void foo696() {} -void foo697() {} -void foo698() {} -void foo699() {} -void foo700() {} -void foo701() {} -void foo702() {} -void foo703() {} -void foo704() {} -void foo705() {} -void foo706() {} -void foo707() {} -void foo708() {} -void foo709() {} -void foo710() {} -void foo711() {} -void foo712() {} -void foo713() {} -void foo714() {} -void foo715() {} -void foo716() {} -void foo717() {} -void foo718() {} -void foo719() {} -void foo720() {} -void foo721() {} -void foo722() {} -void foo723() {} -void foo724() {} -void foo725() {} -void foo726() {} -void foo727() {} -void foo728() {} -void foo729() {} -void foo730() {} -void foo731() {} -void foo732() {} -void foo733() {} -void foo734() {} -void foo735() {} -void foo736() {} -void foo737() {} -void foo738() {} -void foo739() {} -void foo740() {} -void foo741() {} -void foo742() {} -void foo743() {} -void foo744() {} -void foo745() {} -void foo746() {} -void foo747() {} -void foo748() {} -void foo749() {} -void foo750() {} -void foo751() {} -void foo752() {} -void foo753() {} -void foo754() {} -void foo755() {} -void foo756() {} -void foo757() {} -void foo758() {} -void foo759() {} -void foo760() {} -void foo761() {} -void foo762() {} -void foo763() {} -void foo764() {} -void foo765() {} -void foo766() {} -void foo767() {} -void foo768() {} -void foo769() {} -void foo770() {} -void foo771() {} -void foo772() {} -void foo773() {} -void foo774() {} -void foo775() {} -void foo776() {} -void foo777() {} -void foo778() {} -void foo779() {} -void foo780() {} -void foo781() {} -void foo782() {} -void foo783() {} -void foo784() {} -void foo785() {} -void foo786() {} -void foo787() {} -void foo788() {} -void foo789() {} -void foo790() {} -void foo791() {} -void foo792() {} -void foo793() {} -void foo794() {} -void foo795() {} -void foo796() {} -void foo797() {} -void foo798() {} -void foo799() {} -void foo800() {} -void foo801() {} -void foo802() {} -void foo803() {} -void foo804() {} -void foo805() {} -void foo806() {} -void foo807() {} -void foo808() {} -void foo809() {} -void foo810() {} -void foo811() {} -void foo812() {} -void foo813() {} -void foo814() {} -void foo815() {} -void foo816() {} -void foo817() {} -void foo818() {} -void foo819() {} -void foo820() {} -void foo821() {} -void foo822() {} -void foo823() {} -void foo824() {} +void +foo000 (void) {} +void +foo001 (void) {} +void +foo002 (void) {} +void +foo003 (void) {} +void +foo004 (void) {} +void +foo005 (void) {} +void +foo006 (void) {} +void +foo007 (void) {} +void +foo008 (void) {} +void +foo009 (void) {} +void +foo010 (void) {} +void +foo011 (void) {} +void +foo012 (void) {} +void +foo013 (void) {} +void +foo014 (void) {} +void +foo015 (void) {} +void +foo016 (void) {} +void +foo017 (void) {} +void +foo018 (void) {} +void +foo019 (void) {} +void +foo020 (void) {} +void +foo021 (void) {} +void +foo022 (void) {} +void +foo023 (void) {} +void +foo024 (void) {} +void +foo025 (void) {} +void +foo026 (void) {} +void +foo027 (void) {} +void +foo028 (void) {} +void +foo029 (void) {} +void +foo030 (void) {} +void +foo031 (void) {} +void +foo032 (void) {} +void +foo033 (void) {} +void +foo034 (void) {} +void +foo035 (void) {} +void +foo036 (void) {} +void +foo037 (void) {} +void +foo038 (void) {} +void +foo039 (void) {} +void +foo040 (void) {} +void +foo041 (void) {} +void +foo042 (void) {} +void +foo043 (void) {} +void +foo044 (void) {} +void +foo045 (void) {} +void +foo046 (void) {} +void +foo047 (void) {} +void +foo048 (void) {} +void +foo049 (void) {} +void +foo050 (void) {} +void +foo051 (void) {} +void +foo052 (void) {} +void +foo053 (void) {} +void +foo054 (void) {} +void +foo055 (void) {} +void +foo056 (void) {} +void +foo057 (void) {} +void +foo058 (void) {} +void +foo059 (void) {} +void +foo060 (void) {} +void +foo061 (void) {} +void +foo062 (void) {} +void +foo063 (void) {} +void +foo064 (void) {} +void +foo065 (void) {} +void +foo066 (void) {} +void +foo067 (void) {} +void +foo068 (void) {} +void +foo069 (void) {} +void +foo070 (void) {} +void +foo071 (void) {} +void +foo072 (void) {} +void +foo073 (void) {} +void +foo074 (void) {} +void +foo075 (void) {} +void +foo076 (void) {} +void +foo077 (void) {} +void +foo078 (void) {} +void +foo079 (void) {} +void +foo080 (void) {} +void +foo081 (void) {} +void +foo082 (void) {} +void +foo083 (void) {} +void +foo084 (void) {} +void +foo085 (void) {} +void +foo086 (void) {} +void +foo087 (void) {} +void +foo088 (void) {} +void +foo089 (void) {} +void +foo090 (void) {} +void +foo091 (void) {} +void +foo092 (void) {} +void +foo093 (void) {} +void +foo094 (void) {} +void +foo095 (void) {} +void +foo096 (void) {} +void +foo097 (void) {} +void +foo098 (void) {} +void +foo099 (void) {} +void +foo100 (void) {} +void +foo101 (void) {} +void +foo102 (void) {} +void +foo103 (void) {} +void +foo104 (void) {} +void +foo105 (void) {} +void +foo106 (void) {} +void +foo107 (void) {} +void +foo108 (void) {} +void +foo109 (void) {} +void +foo110 (void) {} +void +foo111 (void) {} +void +foo112 (void) {} +void +foo113 (void) {} +void +foo114 (void) {} +void +foo115 (void) {} +void +foo116 (void) {} +void +foo117 (void) {} +void +foo118 (void) {} +void +foo119 (void) {} +void +foo120 (void) {} +void +foo121 (void) {} +void +foo122 (void) {} +void +foo123 (void) {} +void +foo124 (void) {} +void +foo125 (void) {} +void +foo126 (void) {} +void +foo127 (void) {} +void +foo128 (void) {} +void +foo129 (void) {} +void +foo130 (void) {} +void +foo131 (void) {} +void +foo132 (void) {} +void +foo133 (void) {} +void +foo134 (void) {} +void +foo135 (void) {} +void +foo136 (void) {} +void +foo137 (void) {} +void +foo138 (void) {} +void +foo139 (void) {} +void +foo140 (void) {} +void +foo141 (void) {} +void +foo142 (void) {} +void +foo143 (void) {} +void +foo144 (void) {} +void +foo145 (void) {} +void +foo146 (void) {} +void +foo147 (void) {} +void +foo148 (void) {} +void +foo149 (void) {} +void +foo150 (void) {} +void +foo151 (void) {} +void +foo152 (void) {} +void +foo153 (void) {} +void +foo154 (void) {} +void +foo155 (void) {} +void +foo156 (void) {} +void +foo157 (void) {} +void +foo158 (void) {} +void +foo159 (void) {} +void +foo160 (void) {} +void +foo161 (void) {} +void +foo162 (void) {} +void +foo163 (void) {} +void +foo164 (void) {} +void +foo165 (void) {} +void +foo166 (void) {} +void +foo167 (void) {} +void +foo168 (void) {} +void +foo169 (void) {} +void +foo170 (void) {} +void +foo171 (void) {} +void +foo172 (void) {} +void +foo173 (void) {} +void +foo174 (void) {} +void +foo175 (void) {} +void +foo176 (void) {} +void +foo177 (void) {} +void +foo178 (void) {} +void +foo179 (void) {} +void +foo180 (void) {} +void +foo181 (void) {} +void +foo182 (void) {} +void +foo183 (void) {} +void +foo184 (void) {} +void +foo185 (void) {} +void +foo186 (void) {} +void +foo187 (void) {} +void +foo188 (void) {} +void +foo189 (void) {} +void +foo190 (void) {} +void +foo191 (void) {} +void +foo192 (void) {} +void +foo193 (void) {} +void +foo194 (void) {} +void +foo195 (void) {} +void +foo196 (void) {} +void +foo197 (void) {} +void +foo198 (void) {} +void +foo199 (void) {} +void +foo200 (void) {} +void +foo201 (void) {} +void +foo202 (void) {} +void +foo203 (void) {} +void +foo204 (void) {} +void +foo205 (void) {} +void +foo206 (void) {} +void +foo207 (void) {} +void +foo208 (void) {} +void +foo209 (void) {} +void +foo210 (void) {} +void +foo211 (void) {} +void +foo212 (void) {} +void +foo213 (void) {} +void +foo214 (void) {} +void +foo215 (void) {} +void +foo216 (void) {} +void +foo217 (void) {} +void +foo218 (void) {} +void +foo219 (void) {} +void +foo220 (void) {} +void +foo221 (void) {} +void +foo222 (void) {} +void +foo223 (void) {} +void +foo224 (void) {} +void +foo225 (void) {} +void +foo226 (void) {} +void +foo227 (void) {} +void +foo228 (void) {} +void +foo229 (void) {} +void +foo230 (void) {} +void +foo231 (void) {} +void +foo232 (void) {} +void +foo233 (void) {} +void +foo234 (void) {} +void +foo235 (void) {} +void +foo236 (void) {} +void +foo237 (void) {} +void +foo238 (void) {} +void +foo239 (void) {} +void +foo240 (void) {} +void +foo241 (void) {} +void +foo242 (void) {} +void +foo243 (void) {} +void +foo244 (void) {} +void +foo245 (void) {} +void +foo246 (void) {} +void +foo247 (void) {} +void +foo248 (void) {} +void +foo249 (void) {} +void +foo250 (void) {} +void +foo251 (void) {} +void +foo252 (void) {} +void +foo253 (void) {} +void +foo254 (void) {} +void +foo255 (void) {} +void +foo256 (void) {} +void +foo257 (void) {} +void +foo258 (void) {} +void +foo259 (void) {} +void +foo260 (void) {} +void +foo261 (void) {} +void +foo262 (void) {} +void +foo263 (void) {} +void +foo264 (void) {} +void +foo265 (void) {} +void +foo266 (void) {} +void +foo267 (void) {} +void +foo268 (void) {} +void +foo269 (void) {} +void +foo270 (void) {} +void +foo271 (void) {} +void +foo272 (void) {} +void +foo273 (void) {} +void +foo274 (void) {} +void +foo275 (void) {} +void +foo276 (void) {} +void +foo277 (void) {} +void +foo278 (void) {} +void +foo279 (void) {} +void +foo280 (void) {} +void +foo281 (void) {} +void +foo282 (void) {} +void +foo283 (void) {} +void +foo284 (void) {} +void +foo285 (void) {} +void +foo286 (void) {} +void +foo287 (void) {} +void +foo288 (void) {} +void +foo289 (void) {} +void +foo290 (void) {} +void +foo291 (void) {} +void +foo292 (void) {} +void +foo293 (void) {} +void +foo294 (void) {} +void +foo295 (void) {} +void +foo296 (void) {} +void +foo297 (void) {} +void +foo298 (void) {} +void +foo299 (void) {} +void +foo300 (void) {} +void +foo301 (void) {} +void +foo302 (void) {} +void +foo303 (void) {} +void +foo304 (void) {} +void +foo305 (void) {} +void +foo306 (void) {} +void +foo307 (void) {} +void +foo308 (void) {} +void +foo309 (void) {} +void +foo310 (void) {} +void +foo311 (void) {} +void +foo312 (void) {} +void +foo313 (void) {} +void +foo314 (void) {} +void +foo315 (void) {} +void +foo316 (void) {} +void +foo317 (void) {} +void +foo318 (void) {} +void +foo319 (void) {} +void +foo320 (void) {} +void +foo321 (void) {} +void +foo322 (void) {} +void +foo323 (void) {} +void +foo324 (void) {} +void +foo325 (void) {} +void +foo326 (void) {} +void +foo327 (void) {} +void +foo328 (void) {} +void +foo329 (void) {} +void +foo330 (void) {} +void +foo331 (void) {} +void +foo332 (void) {} +void +foo333 (void) {} +void +foo334 (void) {} +void +foo335 (void) {} +void +foo336 (void) {} +void +foo337 (void) {} +void +foo338 (void) {} +void +foo339 (void) {} +void +foo340 (void) {} +void +foo341 (void) {} +void +foo342 (void) {} +void +foo343 (void) {} +void +foo344 (void) {} +void +foo345 (void) {} +void +foo346 (void) {} +void +foo347 (void) {} +void +foo348 (void) {} +void +foo349 (void) {} +void +foo350 (void) {} +void +foo351 (void) {} +void +foo352 (void) {} +void +foo353 (void) {} +void +foo354 (void) {} +void +foo355 (void) {} +void +foo356 (void) {} +void +foo357 (void) {} +void +foo358 (void) {} +void +foo359 (void) {} +void +foo360 (void) {} +void +foo361 (void) {} +void +foo362 (void) {} +void +foo363 (void) {} +void +foo364 (void) {} +void +foo365 (void) {} +void +foo366 (void) {} +void +foo367 (void) {} +void +foo368 (void) {} +void +foo369 (void) {} +void +foo370 (void) {} +void +foo371 (void) {} +void +foo372 (void) {} +void +foo373 (void) {} +void +foo374 (void) {} +void +foo375 (void) {} +void +foo376 (void) {} +void +foo377 (void) {} +void +foo378 (void) {} +void +foo379 (void) {} +void +foo380 (void) {} +void +foo381 (void) {} +void +foo382 (void) {} +void +foo383 (void) {} +void +foo384 (void) {} +void +foo385 (void) {} +void +foo386 (void) {} +void +foo387 (void) {} +void +foo388 (void) {} +void +foo389 (void) {} +void +foo390 (void) {} +void +foo391 (void) {} +void +foo392 (void) {} +void +foo393 (void) {} +void +foo394 (void) {} +void +foo395 (void) {} +void +foo396 (void) {} +void +foo397 (void) {} +void +foo398 (void) {} +void +foo399 (void) {} +void +foo400 (void) {} +void +foo401 (void) {} +void +foo402 (void) {} +void +foo403 (void) {} +void +foo404 (void) {} +void +foo405 (void) {} +void +foo406 (void) {} +void +foo407 (void) {} +void +foo408 (void) {} +void +foo409 (void) {} +void +foo410 (void) {} +void +foo411 (void) {} +void +foo412 (void) {} +void +foo413 (void) {} +void +foo414 (void) {} +void +foo415 (void) {} +void +foo416 (void) {} +void +foo417 (void) {} +void +foo418 (void) {} +void +foo419 (void) {} +void +foo420 (void) {} +void +foo421 (void) {} +void +foo422 (void) {} +void +foo423 (void) {} +void +foo424 (void) {} +void +foo425 (void) {} +void +foo426 (void) {} +void +foo427 (void) {} +void +foo428 (void) {} +void +foo429 (void) {} +void +foo430 (void) {} +void +foo431 (void) {} +void +foo432 (void) {} +void +foo433 (void) {} +void +foo434 (void) {} +void +foo435 (void) {} +void +foo436 (void) {} +void +foo437 (void) {} +void +foo438 (void) {} +void +foo439 (void) {} +void +foo440 (void) {} +void +foo441 (void) {} +void +foo442 (void) {} +void +foo443 (void) {} +void +foo444 (void) {} +void +foo445 (void) {} +void +foo446 (void) {} +void +foo447 (void) {} +void +foo448 (void) {} +void +foo449 (void) {} +void +foo450 (void) {} +void +foo451 (void) {} +void +foo452 (void) {} +void +foo453 (void) {} +void +foo454 (void) {} +void +foo455 (void) {} +void +foo456 (void) {} +void +foo457 (void) {} +void +foo458 (void) {} +void +foo459 (void) {} +void +foo460 (void) {} +void +foo461 (void) {} +void +foo462 (void) {} +void +foo463 (void) {} +void +foo464 (void) {} +void +foo465 (void) {} +void +foo466 (void) {} +void +foo467 (void) {} +void +foo468 (void) {} +void +foo469 (void) {} +void +foo470 (void) {} +void +foo471 (void) {} +void +foo472 (void) {} +void +foo473 (void) {} +void +foo474 (void) {} +void +foo475 (void) {} +void +foo476 (void) {} +void +foo477 (void) {} +void +foo478 (void) {} +void +foo479 (void) {} +void +foo480 (void) {} +void +foo481 (void) {} +void +foo482 (void) {} +void +foo483 (void) {} +void +foo484 (void) {} +void +foo485 (void) {} +void +foo486 (void) {} +void +foo487 (void) {} +void +foo488 (void) {} +void +foo489 (void) {} +void +foo490 (void) {} +void +foo491 (void) {} +void +foo492 (void) {} +void +foo493 (void) {} +void +foo494 (void) {} +void +foo495 (void) {} +void +foo496 (void) {} +void +foo497 (void) {} +void +foo498 (void) {} +void +foo499 (void) {} +void +foo500 (void) {} +void +foo501 (void) {} +void +foo502 (void) {} +void +foo503 (void) {} +void +foo504 (void) {} +void +foo505 (void) {} +void +foo506 (void) {} +void +foo507 (void) {} +void +foo508 (void) {} +void +foo509 (void) {} +void +foo510 (void) {} +void +foo511 (void) {} +void +foo512 (void) {} +void +foo513 (void) {} +void +foo514 (void) {} +void +foo515 (void) {} +void +foo516 (void) {} +void +foo517 (void) {} +void +foo518 (void) {} +void +foo519 (void) {} +void +foo520 (void) {} +void +foo521 (void) {} +void +foo522 (void) {} +void +foo523 (void) {} +void +foo524 (void) {} +void +foo525 (void) {} +void +foo526 (void) {} +void +foo527 (void) {} +void +foo528 (void) {} +void +foo529 (void) {} +void +foo530 (void) {} +void +foo531 (void) {} +void +foo532 (void) {} +void +foo533 (void) {} +void +foo534 (void) {} +void +foo535 (void) {} +void +foo536 (void) {} +void +foo537 (void) {} +void +foo538 (void) {} +void +foo539 (void) {} +void +foo540 (void) {} +void +foo541 (void) {} +void +foo542 (void) {} +void +foo543 (void) {} +void +foo544 (void) {} +void +foo545 (void) {} +void +foo546 (void) {} +void +foo547 (void) {} +void +foo548 (void) {} +void +foo549 (void) {} +void +foo550 (void) {} +void +foo551 (void) {} +void +foo552 (void) {} +void +foo553 (void) {} +void +foo554 (void) {} +void +foo555 (void) {} +void +foo556 (void) {} +void +foo557 (void) {} +void +foo558 (void) {} +void +foo559 (void) {} +void +foo560 (void) {} +void +foo561 (void) {} +void +foo562 (void) {} +void +foo563 (void) {} +void +foo564 (void) {} +void +foo565 (void) {} +void +foo566 (void) {} +void +foo567 (void) {} +void +foo568 (void) {} +void +foo569 (void) {} +void +foo570 (void) {} +void +foo571 (void) {} +void +foo572 (void) {} +void +foo573 (void) {} +void +foo574 (void) {} +void +foo575 (void) {} +void +foo576 (void) {} +void +foo577 (void) {} +void +foo578 (void) {} +void +foo579 (void) {} +void +foo580 (void) {} +void +foo581 (void) {} +void +foo582 (void) {} +void +foo583 (void) {} +void +foo584 (void) {} +void +foo585 (void) {} +void +foo586 (void) {} +void +foo587 (void) {} +void +foo588 (void) {} +void +foo589 (void) {} +void +foo590 (void) {} +void +foo591 (void) {} +void +foo592 (void) {} +void +foo593 (void) {} +void +foo594 (void) {} +void +foo595 (void) {} +void +foo596 (void) {} +void +foo597 (void) {} +void +foo598 (void) {} +void +foo599 (void) {} +void +foo600 (void) {} +void +foo601 (void) {} +void +foo602 (void) {} +void +foo603 (void) {} +void +foo604 (void) {} +void +foo605 (void) {} +void +foo606 (void) {} +void +foo607 (void) {} +void +foo608 (void) {} +void +foo609 (void) {} +void +foo610 (void) {} +void +foo611 (void) {} +void +foo612 (void) {} +void +foo613 (void) {} +void +foo614 (void) {} +void +foo615 (void) {} +void +foo616 (void) {} +void +foo617 (void) {} +void +foo618 (void) {} +void +foo619 (void) {} +void +foo620 (void) {} +void +foo621 (void) {} +void +foo622 (void) {} +void +foo623 (void) {} +void +foo624 (void) {} +void +foo625 (void) {} +void +foo626 (void) {} +void +foo627 (void) {} +void +foo628 (void) {} +void +foo629 (void) {} +void +foo630 (void) {} +void +foo631 (void) {} +void +foo632 (void) {} +void +foo633 (void) {} +void +foo634 (void) {} +void +foo635 (void) {} +void +foo636 (void) {} +void +foo637 (void) {} +void +foo638 (void) {} +void +foo639 (void) {} +void +foo640 (void) {} +void +foo641 (void) {} +void +foo642 (void) {} +void +foo643 (void) {} +void +foo644 (void) {} +void +foo645 (void) {} +void +foo646 (void) {} +void +foo647 (void) {} +void +foo648 (void) {} +void +foo649 (void) {} +void +foo650 (void) {} +void +foo651 (void) {} +void +foo652 (void) {} +void +foo653 (void) {} +void +foo654 (void) {} +void +foo655 (void) {} +void +foo656 (void) {} +void +foo657 (void) {} +void +foo658 (void) {} +void +foo659 (void) {} +void +foo660 (void) {} +void +foo661 (void) {} +void +foo662 (void) {} +void +foo663 (void) {} +void +foo664 (void) {} +void +foo665 (void) {} +void +foo666 (void) {} +void +foo667 (void) {} +void +foo668 (void) {} +void +foo669 (void) {} +void +foo670 (void) {} +void +foo671 (void) {} +void +foo672 (void) {} +void +foo673 (void) {} +void +foo674 (void) {} +void +foo675 (void) {} +void +foo676 (void) {} +void +foo677 (void) {} +void +foo678 (void) {} +void +foo679 (void) {} +void +foo680 (void) {} +void +foo681 (void) {} +void +foo682 (void) {} +void +foo683 (void) {} +void +foo684 (void) {} +void +foo685 (void) {} +void +foo686 (void) {} +void +foo687 (void) {} +void +foo688 (void) {} +void +foo689 (void) {} +void +foo690 (void) {} +void +foo691 (void) {} +void +foo692 (void) {} +void +foo693 (void) {} +void +foo694 (void) {} +void +foo695 (void) {} +void +foo696 (void) {} +void +foo697 (void) {} +void +foo698 (void) {} +void +foo699 (void) {} +void +foo700 (void) {} +void +foo701 (void) {} +void +foo702 (void) {} +void +foo703 (void) {} +void +foo704 (void) {} +void +foo705 (void) {} +void +foo706 (void) {} +void +foo707 (void) {} +void +foo708 (void) {} +void +foo709 (void) {} +void +foo710 (void) {} +void +foo711 (void) {} +void +foo712 (void) {} +void +foo713 (void) {} +void +foo714 (void) {} +void +foo715 (void) {} +void +foo716 (void) {} +void +foo717 (void) {} +void +foo718 (void) {} +void +foo719 (void) {} +void +foo720 (void) {} +void +foo721 (void) {} +void +foo722 (void) {} +void +foo723 (void) {} +void +foo724 (void) {} +void +foo725 (void) {} +void +foo726 (void) {} +void +foo727 (void) {} +void +foo728 (void) {} +void +foo729 (void) {} +void +foo730 (void) {} +void +foo731 (void) {} +void +foo732 (void) {} +void +foo733 (void) {} +void +foo734 (void) {} +void +foo735 (void) {} +void +foo736 (void) {} +void +foo737 (void) {} +void +foo738 (void) {} +void +foo739 (void) {} +void +foo740 (void) {} +void +foo741 (void) {} +void +foo742 (void) {} +void +foo743 (void) {} +void +foo744 (void) {} +void +foo745 (void) {} +void +foo746 (void) {} +void +foo747 (void) {} +void +foo748 (void) {} +void +foo749 (void) {} +void +foo750 (void) {} +void +foo751 (void) {} +void +foo752 (void) {} +void +foo753 (void) {} +void +foo754 (void) {} +void +foo755 (void) {} +void +foo756 (void) {} +void +foo757 (void) {} +void +foo758 (void) {} +void +foo759 (void) {} +void +foo760 (void) {} +void +foo761 (void) {} +void +foo762 (void) {} +void +foo763 (void) {} +void +foo764 (void) {} +void +foo765 (void) {} +void +foo766 (void) {} +void +foo767 (void) {} +void +foo768 (void) {} +void +foo769 (void) {} +void +foo770 (void) {} +void +foo771 (void) {} +void +foo772 (void) {} +void +foo773 (void) {} +void +foo774 (void) {} +void +foo775 (void) {} +void +foo776 (void) {} +void +foo777 (void) {} +void +foo778 (void) {} +void +foo779 (void) {} +void +foo780 (void) {} +void +foo781 (void) {} +void +foo782 (void) {} +void +foo783 (void) {} +void +foo784 (void) {} +void +foo785 (void) {} +void +foo786 (void) {} +void +foo787 (void) {} +void +foo788 (void) {} +void +foo789 (void) {} +void +foo790 (void) {} +void +foo791 (void) {} +void +foo792 (void) {} +void +foo793 (void) {} +void +foo794 (void) {} +void +foo795 (void) {} +void +foo796 (void) {} +void +foo797 (void) {} +void +foo798 (void) {} +void +foo799 (void) {} +void +foo800 (void) {} +void +foo801 (void) {} +void +foo802 (void) {} +void +foo803 (void) {} +void +foo804 (void) {} +void +foo805 (void) {} +void +foo806 (void) {} +void +foo807 (void) {} +void +foo808 (void) {} +void +foo809 (void) {} +void +foo810 (void) {} +void +foo811 (void) {} +void +foo812 (void) {} +void +foo813 (void) {} +void +foo814 (void) {} +void +foo815 (void) {} +void +foo816 (void) {} +void +foo817 (void) {} +void +foo818 (void) {} +void +foo819 (void) {} +void +foo820 (void) {} +void +foo821 (void) {} +void +foo822 (void) {} +void +foo823 (void) {} +void +foo824 (void) {} diff --git a/dyld/unit-tests/test-cases/big-jump-table/main.c b/dyld/unit-tests/test-cases/big-jump-table/main.c index 6241ef45..cd1ada43 100644 --- a/dyld/unit-tests/test-cases/big-jump-table/main.c +++ b/dyld/unit-tests/test-cases/big-jump-table/main.c @@ -27,7 +27,8 @@ -int main() +int +main (void) { PASS("big-jump-table"); return EXIT_SUCCESS; diff --git a/dyld/unit-tests/test-cases/big-jump-table/pointers.c b/dyld/unit-tests/test-cases/big-jump-table/pointers.c index 5484be0d..d793e220 100644 --- a/dyld/unit-tests/test-cases/big-jump-table/pointers.c +++ b/dyld/unit-tests/test-cases/big-jump-table/pointers.c @@ -1,7 +1,8 @@ #include "foo.h" -long useNonLazy() +long +useNonLazy (void) { long result = 0; result += (long)&foo001; diff --git a/dyld/unit-tests/test-cases/big-stack/main.c b/dyld/unit-tests/test-cases/big-stack/main.c index 2c83e2d6..7ad58dfe 100644 --- a/dyld/unit-tests/test-cases/big-stack/main.c +++ b/dyld/unit-tests/test-cases/big-stack/main.c @@ -49,8 +49,8 @@ void foo(unsigned long long stackSize, char* stackStart) } -int -main() +int +main (void) { char start; foo(STACK_SIZE, &start); diff --git a/dyld/unit-tests/test-cases/branch-islands/main.c b/dyld/unit-tests/test-cases/branch-islands/main.c index 9a265a03..cb99d493 100644 --- a/dyld/unit-tests/test-cases/branch-islands/main.c +++ b/dyld/unit-tests/test-cases/branch-islands/main.c @@ -11,7 +11,8 @@ extern bool test1(); const char* str = "hello"; -int main() +int +main (void) { if ( test1() ) FAIL("branch-islands: test1"); diff --git a/dyld/unit-tests/test-cases/bundle-basic/main.c b/dyld/unit-tests/test-cases/bundle-basic/main.c index 49d30c37..b7129d3a 100644 --- a/dyld/unit-tests/test-cases/bundle-basic/main.c +++ b/dyld/unit-tests/test-cases/bundle-basic/main.c @@ -29,7 +29,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // these APIs are only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-dont-gc/bar.c b/dyld/unit-tests/test-cases/bundle-dont-gc/bar.c index 3aee7ab2..7b842f0c 100644 --- a/dyld/unit-tests/test-cases/bundle-dont-gc/bar.c +++ b/dyld/unit-tests/test-cases/bundle-dont-gc/bar.c @@ -1,3 +1,4 @@ -void bar() {} +void +bar (void) {} diff --git a/dyld/unit-tests/test-cases/bundle-dont-gc/foo.c b/dyld/unit-tests/test-cases/bundle-dont-gc/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/bundle-dont-gc/foo.c +++ b/dyld/unit-tests/test-cases/bundle-dont-gc/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/bundle-memory-load-all-infos/main.c b/dyld/unit-tests/test-cases/bundle-memory-load-all-infos/main.c index 87eacca1..558fc69a 100644 --- a/dyld/unit-tests/test-cases/bundle-memory-load-all-infos/main.c +++ b/dyld/unit-tests/test-cases/bundle-memory-load-all-infos/main.c @@ -35,7 +35,8 @@ #include "test.h" // PASS(), FAIL() -struct dyld_all_image_infos* getImageInfosFromKernel() +struct dyld_all_image_infos * +getImageInfosFromKernel (void) { task_dyld_info_data_t task_dyld_info; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; @@ -48,7 +49,8 @@ struct dyld_all_image_infos* getImageInfosFromKernel() } -int main() +int +main (void) { // NSObjectFileImage APIs are only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-memory-load-bad/bundle.c b/dyld/unit-tests/test-cases/bundle-memory-load-bad/bundle.c index 75561388..d9b672c3 100644 --- a/dyld/unit-tests/test-cases/bundle-memory-load-bad/bundle.c +++ b/dyld/unit-tests/test-cases/bundle-memory-load-bad/bundle.c @@ -22,7 +22,8 @@ */ -int main() +int +main (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/bundle-memory-load-bad/main.c b/dyld/unit-tests/test-cases/bundle-memory-load-bad/main.c index 7e8c93c8..fd71eb78 100644 --- a/dyld/unit-tests/test-cases/bundle-memory-load-bad/main.c +++ b/dyld/unit-tests/test-cases/bundle-memory-load-bad/main.c @@ -32,7 +32,8 @@ #include "test.h" // PASS(), FAIL() -int main() +int +main (void) { // NSAddImage is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-memory-load-fat/bundle.c b/dyld/unit-tests/test-cases/bundle-memory-load-fat/bundle.c index 3f96d53c..f9b685ac 100644 --- a/dyld/unit-tests/test-cases/bundle-memory-load-fat/bundle.c +++ b/dyld/unit-tests/test-cases/bundle-memory-load-fat/bundle.c @@ -25,7 +25,8 @@ // test to see if bss section is properly expanded -void check() +void +check (void) { } diff --git a/dyld/unit-tests/test-cases/bundle-memory-load-fat/main.c b/dyld/unit-tests/test-cases/bundle-memory-load-fat/main.c index 05ef670e..7d44cc4e 100644 --- a/dyld/unit-tests/test-cases/bundle-memory-load-fat/main.c +++ b/dyld/unit-tests/test-cases/bundle-memory-load-fat/main.c @@ -34,7 +34,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSObjectFileImage APIs only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-memory-load-malloc/main.c b/dyld/unit-tests/test-cases/bundle-memory-load-malloc/main.c index 47e87924..7a6931ac 100644 --- a/dyld/unit-tests/test-cases/bundle-memory-load-malloc/main.c +++ b/dyld/unit-tests/test-cases/bundle-memory-load-malloc/main.c @@ -37,7 +37,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-memory-load/main.c b/dyld/unit-tests/test-cases/bundle-memory-load/main.c index 7af9854f..2be593ab 100644 --- a/dyld/unit-tests/test-cases/bundle-memory-load/main.c +++ b/dyld/unit-tests/test-cases/bundle-memory-load/main.c @@ -34,7 +34,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSObjectFileImage APIs are only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-multi-link/bundle.c b/dyld/unit-tests/test-cases/bundle-multi-link/bundle.c index 9871eea7..b481f915 100644 --- a/dyld/unit-tests/test-cases/bundle-multi-link/bundle.c +++ b/dyld/unit-tests/test-cases/bundle-multi-link/bundle.c @@ -23,7 +23,8 @@ static int value = 0; -int getValue() +int +getValue (void) { return value; } diff --git a/dyld/unit-tests/test-cases/bundle-multi-link/main.c b/dyld/unit-tests/test-cases/bundle-multi-link/main.c index c15bd031..e315b254 100644 --- a/dyld/unit-tests/test-cases/bundle-multi-link/main.c +++ b/dyld/unit-tests/test-cases/bundle-multi-link/main.c @@ -36,7 +36,8 @@ typedef void (*setter)(int); typedef int (*getter)(void); -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-multi-load/bundle.c b/dyld/unit-tests/test-cases/bundle-multi-load/bundle.c index 84955c45..e43325a9 100644 --- a/dyld/unit-tests/test-cases/bundle-multi-load/bundle.c +++ b/dyld/unit-tests/test-cases/bundle-multi-load/bundle.c @@ -20,7 +20,8 @@ * * @APPLE_LICENSE_HEADER_END@ */ -int foo() +int +foo (void) { return 4; } diff --git a/dyld/unit-tests/test-cases/bundle-multi-load/main.c b/dyld/unit-tests/test-cases/bundle-multi-load/main.c index ab0382a4..ce987a0b 100644 --- a/dyld/unit-tests/test-cases/bundle-multi-load/main.c +++ b/dyld/unit-tests/test-cases/bundle-multi-load/main.c @@ -31,7 +31,8 @@ /// verify each time it is linked is a new instantiations (new globals, etc) /// -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-name-ownership/main.c b/dyld/unit-tests/test-cases/bundle-name-ownership/main.c index 15c55635..a847fe56 100644 --- a/dyld/unit-tests/test-cases/bundle-name-ownership/main.c +++ b/dyld/unit-tests/test-cases/bundle-name-ownership/main.c @@ -29,7 +29,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-private/bundle.c b/dyld/unit-tests/test-cases/bundle-private/bundle.c index b7cdc4f4..ba9ee8e6 100644 --- a/dyld/unit-tests/test-cases/bundle-private/bundle.c +++ b/dyld/unit-tests/test-cases/bundle-private/bundle.c @@ -23,6 +23,7 @@ // test to see if NSLINKMODULE_OPTION_PRIVATE works -void findme() +void +findme (void) { } diff --git a/dyld/unit-tests/test-cases/bundle-private/main.c b/dyld/unit-tests/test-cases/bundle-private/main.c index 2a35990c..c2788178 100644 --- a/dyld/unit-tests/test-cases/bundle-private/main.c +++ b/dyld/unit-tests/test-cases/bundle-private/main.c @@ -29,7 +29,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-reload/main.c b/dyld/unit-tests/test-cases/bundle-reload/main.c index 9f0f0c12..fef9e558 100644 --- a/dyld/unit-tests/test-cases/bundle-reload/main.c +++ b/dyld/unit-tests/test-cases/bundle-reload/main.c @@ -35,7 +35,8 @@ typedef void (*fooProc)(); // test.bundle -void doit() +void +doit (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED @@ -83,7 +84,8 @@ static void myRemoveImage(const struct mach_header *mh, intptr_t vmaddr_slide) } -int main() +int +main (void) { _dyld_register_func_for_remove_image(&myRemoveImage); diff --git a/dyld/unit-tests/test-cases/bundle-terminator/main.c b/dyld/unit-tests/test-cases/bundle-terminator/main.c index d7fd7076..fd614286 100644 --- a/dyld/unit-tests/test-cases/bundle-terminator/main.c +++ b/dyld/unit-tests/test-cases/bundle-terminator/main.c @@ -29,7 +29,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-unlinkable/bundle.c b/dyld/unit-tests/test-cases/bundle-unlinkable/bundle.c index 8f91e114..7c4eec6d 100644 --- a/dyld/unit-tests/test-cases/bundle-unlinkable/bundle.c +++ b/dyld/unit-tests/test-cases/bundle-unlinkable/bundle.c @@ -23,7 +23,8 @@ extern int bar(); -int foo() +int +foo (void) { return bar(); } diff --git a/dyld/unit-tests/test-cases/bundle-unlinkable/lib.c b/dyld/unit-tests/test-cases/bundle-unlinkable/lib.c index 541b9642..96b39041 100644 --- a/dyld/unit-tests/test-cases/bundle-unlinkable/lib.c +++ b/dyld/unit-tests/test-cases/bundle-unlinkable/lib.c @@ -23,7 +23,8 @@ -int bar() +int +bar (void) { return 0; } \ No newline at end of file diff --git a/dyld/unit-tests/test-cases/bundle-unlinkable/main.c b/dyld/unit-tests/test-cases/bundle-unlinkable/main.c index bccdf8d6..d91cabcc 100644 --- a/dyld/unit-tests/test-cases/bundle-unlinkable/main.c +++ b/dyld/unit-tests/test-cases/bundle-unlinkable/main.c @@ -29,7 +29,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-unload-keep-mapped/main.c b/dyld/unit-tests/test-cases/bundle-unload-keep-mapped/main.c index 018ee9e7..e5c6fe35 100644 --- a/dyld/unit-tests/test-cases/bundle-unload-keep-mapped/main.c +++ b/dyld/unit-tests/test-cases/bundle-unload-keep-mapped/main.c @@ -29,7 +29,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/bundle-v-dylib/bar.c b/dyld/unit-tests/test-cases/bundle-v-dylib/bar.c index 65f9d64c..7308ec22 100644 --- a/dyld/unit-tests/test-cases/bundle-v-dylib/bar.c +++ b/dyld/unit-tests/test-cases/bundle-v-dylib/bar.c @@ -23,7 +23,8 @@ #include -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/bundle-v-dylib/foo.c b/dyld/unit-tests/test-cases/bundle-v-dylib/foo.c index 91fbe467..27830d57 100644 --- a/dyld/unit-tests/test-cases/bundle-v-dylib/foo.c +++ b/dyld/unit-tests/test-cases/bundle-v-dylib/foo.c @@ -23,7 +23,8 @@ #include -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/bundle-v-dylib/main.c b/dyld/unit-tests/test-cases/bundle-v-dylib/main.c index aea5c6f6..937372b5 100644 --- a/dyld/unit-tests/test-cases/bundle-v-dylib/main.c +++ b/dyld/unit-tests/test-cases/bundle-v-dylib/main.c @@ -87,7 +87,8 @@ void loadAsDylib(const char* path) #endif -int main() +int +main (void) { #if __MAC_OS_X_VERSION_MIN_REQUIRED int dummy; diff --git a/dyld/unit-tests/test-cases/bundle-weak/main.c b/dyld/unit-tests/test-cases/bundle-weak/main.c index 814c4064..f6f15191 100644 --- a/dyld/unit-tests/test-cases/bundle-weak/main.c +++ b/dyld/unit-tests/test-cases/bundle-weak/main.c @@ -29,7 +29,8 @@ typedef bool (*CheckFunc)(); -int main() +int +main (void) { void* handle = dlopen("test.bundle", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/foo.c b/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/foo.c index 3f2cbaf4..ba4a0da4 100644 --- a/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/foo.c +++ b/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/foo.c @@ -1,4 +1,7 @@ -void foo() {} -void bar() {} -void baz() {} +void +foo (void) {} +void +bar (void) {} +void +baz (void) {} diff --git a/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/main.c b/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/main.c index d5199c98..a3751eb2 100644 --- a/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/main.c +++ b/dyld/unit-tests/test-cases/concurrent-dlopen-initializers/main.c @@ -53,7 +53,8 @@ static const char* batchMappedHandler(enum dyld_image_states state, uint32_t inf } -int main() +int +main (void) { // tell dyld we want to know when images are mapped dyld_register_image_state_change_handler(dyld_image_state_initialized, false, batchMappedHandler); diff --git a/dyld/unit-tests/test-cases/coreSymbolication-notify/foo.c b/dyld/unit-tests/test-cases/coreSymbolication-notify/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/coreSymbolication-notify/foo.c +++ b/dyld/unit-tests/test-cases/coreSymbolication-notify/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/crt-result/bad.c b/dyld/unit-tests/test-cases/crt-result/bad.c index 40cbb542..2a2043fb 100644 --- a/dyld/unit-tests/test-cases/crt-result/bad.c +++ b/dyld/unit-tests/test-cases/crt-result/bad.c @@ -1 +1,2 @@ -int main() { return 1; } +int +main (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/crt-result/good.c b/dyld/unit-tests/test-cases/crt-result/good.c index 76e81970..07e058cb 100644 --- a/dyld/unit-tests/test-cases/crt-result/good.c +++ b/dyld/unit-tests/test-cases/crt-result/good.c @@ -1 +1,2 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/cxa_finalize/main.c b/dyld/unit-tests/test-cases/cxa_finalize/main.c index d1b62d5f..8e27bc3f 100644 --- a/dyld/unit-tests/test-cases/cxa_finalize/main.c +++ b/dyld/unit-tests/test-cases/cxa_finalize/main.c @@ -28,7 +28,8 @@ -int main() +int +main (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/deadlock/bar.c b/dyld/unit-tests/test-cases/deadlock/bar.c index ea63b5f2..bc828883 100644 --- a/dyld/unit-tests/test-cases/deadlock/bar.c +++ b/dyld/unit-tests/test-cases/deadlock/bar.c @@ -22,7 +22,8 @@ */ -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/deadlock/foo.c b/dyld/unit-tests/test-cases/deadlock/foo.c index 8b9c637a..89a1c988 100644 --- a/dyld/unit-tests/test-cases/deadlock/foo.c +++ b/dyld/unit-tests/test-cases/deadlock/foo.c @@ -22,7 +22,8 @@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/deadlock/main.c b/dyld/unit-tests/test-cases/deadlock/main.c index 21e64462..70462c7b 100644 --- a/dyld/unit-tests/test-cases/deadlock/main.c +++ b/dyld/unit-tests/test-cases/deadlock/main.c @@ -94,7 +94,8 @@ static void myImageHandler(const struct mach_header *mh, intptr_t vmaddr_slide) } #endif -int main() +int +main (void) { #if __MAC_OS_X_VERSION_MIN_REQUIRED pthread_mutex_init(&sBarrierMutex, NULL); diff --git a/dyld/unit-tests/test-cases/dladdr-stripped/main.c b/dyld/unit-tests/test-cases/dladdr-stripped/main.c index 4f8901a4..ea87b84b 100644 --- a/dyld/unit-tests/test-cases/dladdr-stripped/main.c +++ b/dyld/unit-tests/test-cases/dladdr-stripped/main.c @@ -34,7 +34,8 @@ /// main executable (and not _mh_execute_header+nnn). /// -int main() +int +main (void) { Dl_info info; if ( dladdr(&main, &info) == 0 ) { diff --git a/dyld/unit-tests/test-cases/dlclose-basic/foo.c b/dyld/unit-tests/test-cases/dlclose-basic/foo.c index 39ab8be5..199c0318 100644 --- a/dyld/unit-tests/test-cases/dlclose-basic/foo.c +++ b/dyld/unit-tests/test-cases/dlclose-basic/foo.c @@ -20,7 +20,8 @@ * * @APPLE_LICENSE_HEADER_END@ */ -int foo() +int +foo (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/dlclose-basic/main.c b/dyld/unit-tests/test-cases/dlclose-basic/main.c index ee7c1226..c2c6e655 100644 --- a/dyld/unit-tests/test-cases/dlclose-basic/main.c +++ b/dyld/unit-tests/test-cases/dlclose-basic/main.c @@ -28,7 +28,8 @@ -int main() +int +main (void) { // regular open void* handle = dlopen("test.bundle", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlclose-bundle-unload/foo.c b/dyld/unit-tests/test-cases/dlclose-bundle-unload/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlclose-bundle-unload/foo.c +++ b/dyld/unit-tests/test-cases/dlclose-bundle-unload/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlclose-bundle-unload/main.c b/dyld/unit-tests/test-cases/dlclose-bundle-unload/main.c index 3e0798ae..361c52a2 100644 --- a/dyld/unit-tests/test-cases/dlclose-bundle-unload/main.c +++ b/dyld/unit-tests/test-cases/dlclose-bundle-unload/main.c @@ -26,7 +26,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int main() +int +main (void) { // open same bundle three times void* handle1 = dlopen("test.bundle", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-dynamic-ref/main.c b/dyld/unit-tests/test-cases/dlclose-dylib-dynamic-ref/main.c index 9c39733a..64999556 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-dynamic-ref/main.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-dynamic-ref/main.c @@ -29,7 +29,8 @@ -int main() +int +main (void) { Dl_info info; diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/bar.c b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/bar.c index 8312b899..4ac5a176 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/bar.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/bar.c @@ -1,6 +1,7 @@ -int bar() +int +bar (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/base.c b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/base.c index e7e0d08a..4352dbf9 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/base.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/base.c @@ -1 +1,2 @@ -void base() { } +void +base (void) { } diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/foo.c b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/foo.c index 8184cd12..05b4f3c9 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/foo.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/main.c b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/main.c index 5902d821..03f82fa8 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/main.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-ref-count/main.c @@ -29,7 +29,8 @@ -int main() +int +main (void) { Dl_info info; diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-terminators/baz.c b/dyld/unit-tests/test-cases/dlclose-dylib-terminators/baz.c index b5a740ec..770f2fb8 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-terminators/baz.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-terminators/baz.c @@ -1,7 +1,8 @@ int bazData = 5; -int baz() +int +baz (void) { return bazData; } diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-terminators/main.c b/dyld/unit-tests/test-cases/dlclose-dylib-terminators/main.c index 34d2d0d7..6010bfae 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-terminators/main.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-terminators/main.c @@ -29,7 +29,8 @@ -int main() +int +main (void) { // load foo void* handleFoo = dlopen("libfoo.dylib", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-unload/bar.c b/dyld/unit-tests/test-cases/dlclose-dylib-unload/bar.c index 817b8cd5..64e1e218 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-unload/bar.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-unload/bar.c @@ -22,7 +22,8 @@ */ -int bar() +int +bar (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-unload/foo.c b/dyld/unit-tests/test-cases/dlclose-dylib-unload/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-unload/foo.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-unload/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlclose-dylib-unload/main.c b/dyld/unit-tests/test-cases/dlclose-dylib-unload/main.c index 5e48c00c..1d477447 100644 --- a/dyld/unit-tests/test-cases/dlclose-dylib-unload/main.c +++ b/dyld/unit-tests/test-cases/dlclose-dylib-unload/main.c @@ -30,7 +30,8 @@ -void verifyfoo() +void +verifyfoo (void) { // open same dylib three times void* handle1 = dlopen("libfoo.dylib", RTLD_LAZY); @@ -91,7 +92,8 @@ void verifyfoo() -void verifybar() +void +verifybar (void) { // open same dylib three times void* handle1 = dlopen("libbar.dylib", RTLD_LAZY); @@ -152,7 +154,8 @@ void verifybar() // verify libbar.dylib can be loaded and unloaded // verify libbar.dylib can be loaded, but cannot be unloaded (because main executable links against it) -int main() +int +main (void) { verifyfoo(); verifybar(); diff --git a/dyld/unit-tests/test-cases/dlclose-order/foo.c b/dyld/unit-tests/test-cases/dlclose-order/foo.c index 39ab8be5..199c0318 100644 --- a/dyld/unit-tests/test-cases/dlclose-order/foo.c +++ b/dyld/unit-tests/test-cases/dlclose-order/foo.c @@ -20,7 +20,8 @@ * * @APPLE_LICENSE_HEADER_END@ */ -int foo() +int +foo (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/bar.c b/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/bar.c index 6cd208d2..cdf6413e 100644 --- a/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/bar.c +++ b/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/bar.c @@ -22,7 +22,8 @@ */ -int bar() +int +bar (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/main.c b/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/main.c index 90ea7790..9b5b29e9 100644 --- a/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/main.c +++ b/dyld/unit-tests/test-cases/dlclose-terminator-dlclose/main.c @@ -28,7 +28,8 @@ -int main() +int +main (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/dlclose-unload-c++/main.c b/dyld/unit-tests/test-cases/dlclose-unload-c++/main.c index 8300a410..e6a73853 100644 --- a/dyld/unit-tests/test-cases/dlclose-unload-c++/main.c +++ b/dyld/unit-tests/test-cases/dlclose-unload-c++/main.c @@ -41,7 +41,8 @@ bool inImage(void* x) } -int main() +int +main (void) { void* handle1 = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle1 == NULL ) { diff --git a/dyld/unit-tests/test-cases/dlclose-unmap/foo.c b/dyld/unit-tests/test-cases/dlclose-unmap/foo.c index 8826cbaa..07000280 100644 --- a/dyld/unit-tests/test-cases/dlclose-unmap/foo.c +++ b/dyld/unit-tests/test-cases/dlclose-unmap/foo.c @@ -1,2 +1,3 @@ -void foo() {} \ No newline at end of file +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/dlclose-unmap/main.c b/dyld/unit-tests/test-cases/dlclose-unmap/main.c index a2c3cbfb..28998e1e 100644 --- a/dyld/unit-tests/test-cases/dlclose-unmap/main.c +++ b/dyld/unit-tests/test-cases/dlclose-unmap/main.c @@ -64,7 +64,8 @@ static void trySO(const char* path) } -int main() +int +main (void) { trySO("test.bundle"); trySO("test.dylib"); diff --git a/dyld/unit-tests/test-cases/dlerror-clear/main.c b/dyld/unit-tests/test-cases/dlerror-clear/main.c index f70cc867..9676a452 100644 --- a/dyld/unit-tests/test-cases/dlerror-clear/main.c +++ b/dyld/unit-tests/test-cases/dlerror-clear/main.c @@ -33,7 +33,8 @@ /// This tests that the dlerror message is cleared when dlerror is called /// -int main() +int +main (void) { // try to non-existent library void* handle1 = dlopen("frobulite", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlerror/main.c b/dyld/unit-tests/test-cases/dlerror/main.c index 71ed8ab7..362aa402 100644 --- a/dyld/unit-tests/test-cases/dlerror/main.c +++ b/dyld/unit-tests/test-cases/dlerror/main.c @@ -57,7 +57,8 @@ static void* work(void* arg) -int main() +int +main (void) { dlsym(RTLD_DEFAULT, "foobar"); //fprintf(stderr, "%s\n", dlerror()); diff --git a/dyld/unit-tests/test-cases/dlopen-DYLD_FALLBACK_LIBRARY_PATH/foo.c b/dyld/unit-tests/test-cases/dlopen-DYLD_FALLBACK_LIBRARY_PATH/foo.c index 33c0685b..c969ee43 100644 --- a/dyld/unit-tests/test-cases/dlopen-DYLD_FALLBACK_LIBRARY_PATH/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-DYLD_FALLBACK_LIBRARY_PATH/foo.c @@ -1,6 +1,7 @@ -int foo() +int +foo (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/dlopen-DYLD_LIBRARY_PATH/foo.c b/dyld/unit-tests/test-cases/dlopen-DYLD_LIBRARY_PATH/foo.c index 0502e90e..d74fd11c 100644 --- a/dyld/unit-tests/test-cases/dlopen-DYLD_LIBRARY_PATH/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-DYLD_LIBRARY_PATH/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { #ifdef ALT return 1; diff --git a/dyld/unit-tests/test-cases/dlopen-LD_LIBRARY_PATH/foo.c b/dyld/unit-tests/test-cases/dlopen-LD_LIBRARY_PATH/foo.c index de65df55..d9d35c19 100644 --- a/dyld/unit-tests/test-cases/dlopen-LD_LIBRARY_PATH/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-LD_LIBRARY_PATH/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return VALUE; } diff --git a/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/foo.c b/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/foo.c index fea884b9..b6b2c589 100644 --- a/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/main.c b/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/main.c index b86c5e58..6a97e56a 100644 --- a/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/main.c +++ b/dyld/unit-tests/test-cases/dlopen-NULL-RTLD_FIRST/main.c @@ -73,7 +73,8 @@ static void dlsym_should_succeed(info hp, const char* symbol) } -int main() +int +main (void) { int result; info mainFirst = dlopen_or_fail(NULL, RTLD_FIRST); @@ -101,6 +102,7 @@ int main() } -void main_foo() {} +void +main_foo (void) {} diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/bar.c b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/bar.c index 7ef59fba..a6458ed7 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/bar.c @@ -22,7 +22,8 @@ */ -int bar() +int +bar (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/base.c b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/base.c index 87bb46c9..fd33f9f4 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/base.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/base.c @@ -22,7 +22,8 @@ */ -int base() +int +base (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/foo.c b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/foo.c index fea884b9..b6b2c589 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/main.c b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/main.c index 95d3ce44..ba3aa753 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/main.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_FIRST/main.c @@ -73,7 +73,8 @@ static void dlsym_should_succeed(info hp, const char* symbol) } -int main() +int +main (void) { info libFooFirst = dlopen_or_fail("libfoo.dylib", RTLD_FIRST); info libFoo = dlopen_or_fail("libfoo.dylib", 0); diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_GLOBAL/bar.c b/dyld/unit-tests/test-cases/dlopen-RTLD_GLOBAL/bar.c index e8e0806a..0fedb023 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_GLOBAL/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_GLOBAL/bar.c @@ -23,7 +23,8 @@ extern int foo; -int bar() +int +bar (void) { return foo; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/bar.c b/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/bar.c index 73b29f26..3d83b3b6 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/bar.c @@ -22,7 +22,8 @@ */ -int bar() +int +bar (void) { return 2; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/foo.c b/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/foo.c index d040e48c..e4353d54 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL-ignore/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL/bar.c b/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL/bar.c index e8e0806a..0fedb023 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_LOCAL/bar.c @@ -23,7 +23,8 @@ extern int foo; -int bar() +int +bar (void) { return foo; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NODELETE/main.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NODELETE/main.c index 296479ef..2733c571 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NODELETE/main.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NODELETE/main.c @@ -64,7 +64,8 @@ static int trySO(const char* path) } -int main() +int +main (void) { trySO("test.bundle"); trySO("test.dylib"); diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-fallback/foo.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-fallback/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-fallback/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-fallback/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/base.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/base.c index 3bcd1643..bde1ec12 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/base.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/base.c @@ -26,7 +26,8 @@ static bool inited = false; -void setBazInitialized() { inited = true; } +void +setBazInitialized (void) { inited = true; } bool bazInitialized() { return inited; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/main.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/main.c index 9b67e375..8b6be840 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/main.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-in-initializer/main.c @@ -29,7 +29,8 @@ typedef bool (*fooProc)(void); -int main() +int +main (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/bar.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/bar.c index 7fe64038..831c7de9 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/bar.c @@ -1 +1,2 @@ -int bar() { return 0; } +int +bar (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/foo.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/foo.c index c58fc07e..e749a978 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD-symlink/foo.c @@ -1,2 +1,3 @@ -int foo() { return 0; } +int +foo (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/foo.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/main.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/main.c index 7383a8c8..fa4def4d 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/main.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOLOAD/main.c @@ -33,7 +33,8 @@ /// -int main() +int +main (void) { // main links against libfoo.dylib so it should already be loaded void* handle = dlopen("libfoo.dylib", RTLD_NOLOAD); diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/bundle.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/bundle.c index 5772ff48..5461b53a 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/bundle.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/bundle.c @@ -25,7 +25,8 @@ extern int foo(); extern int foo2(); -void doit() +void +doit (void) { foo(); foo2(); diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/foo.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/foo.c index e9377709..a6fd216d 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/foo.c @@ -22,13 +22,15 @@ */ -int foo() +int +foo (void) { return 10; } #if FOO2 -int foo2() +int +foo2 (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/main.c b/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/main.c index 2ebb4ad8..918e5e69 100644 --- a/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/main.c +++ b/dyld/unit-tests/test-cases/dlopen-RTLD_NOW/main.c @@ -36,7 +36,8 @@ /// -int main() +int +main (void) { void* handle = dlopen("test.bundle", RTLD_NOW); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/dlopen-basic/foo.c b/dyld/unit-tests/test-cases/dlopen-basic/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlopen-basic/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-basic/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-basic/main.c b/dyld/unit-tests/test-cases/dlopen-basic/main.c index f877537c..2111f8a0 100644 --- a/dyld/unit-tests/test-cases/dlopen-basic/main.c +++ b/dyld/unit-tests/test-cases/dlopen-basic/main.c @@ -57,7 +57,8 @@ static void trySO(const char* path) -int main() +int +main (void) { trySO("test.bundle"); trySO("test.dylib"); diff --git a/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/foo.c b/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/main.c b/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/main.c index 37dba846..2d93be1c 100644 --- a/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/main.c +++ b/dyld/unit-tests/test-cases/dlopen-codesign-dynamic/main.c @@ -11,7 +11,8 @@ #include "test.h" -int main() +int +main (void) { #if ENFORCE uint32_t flags = CS_ENFORCEMENT | CS_KILL; diff --git a/dyld/unit-tests/test-cases/dlopen-codesign/foo.c b/dyld/unit-tests/test-cases/dlopen-codesign/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/dlopen-codesign/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-codesign/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/dlopen-codesign/main.c b/dyld/unit-tests/test-cases/dlopen-codesign/main.c index 53fce5f5..db5cdaaa 100644 --- a/dyld/unit-tests/test-cases/dlopen-codesign/main.c +++ b/dyld/unit-tests/test-cases/dlopen-codesign/main.c @@ -9,7 +9,8 @@ #include "test.h" -int main() +int +main (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle != NULL ) { diff --git a/dyld/unit-tests/test-cases/dlopen-dyld-locking/main.c b/dyld/unit-tests/test-cases/dlopen-dyld-locking/main.c index 3c68a9d5..776635c9 100644 --- a/dyld/unit-tests/test-cases/dlopen-dyld-locking/main.c +++ b/dyld/unit-tests/test-cases/dlopen-dyld-locking/main.c @@ -46,7 +46,8 @@ static void* work(void* arg) } -int main() +int +main (void) { pthread_t otherThread; if ( pthread_create(&otherThread, NULL, work, NULL) != 0 ) { diff --git a/dyld/unit-tests/test-cases/dlopen-error/foo.c b/dyld/unit-tests/test-cases/dlopen-error/foo.c index 0fd6c1e7..07000280 100644 --- a/dyld/unit-tests/test-cases/dlopen-error/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-error/foo.c @@ -1,2 +1,3 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/dlopen-error/main.c b/dyld/unit-tests/test-cases/dlopen-error/main.c index 481db0c2..1035f662 100644 --- a/dyld/unit-tests/test-cases/dlopen-error/main.c +++ b/dyld/unit-tests/test-cases/dlopen-error/main.c @@ -29,7 +29,8 @@ -int main() +int +main (void) { // test error message of a dylib that does not exist void* handle = dlopen("libdoesnotexist.dylib", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlopen-executable/foo.c b/dyld/unit-tests/test-cases/dlopen-executable/foo.c index d6390113..52fc5bfd 100644 --- a/dyld/unit-tests/test-cases/dlopen-executable/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-executable/foo.c @@ -1,9 +1,11 @@ -int foo() +int +foo (void) { return 10; } -int main() +int +main (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/dlopen-executable/main.c b/dyld/unit-tests/test-cases/dlopen-executable/main.c index a9a6f21f..527eaf77 100644 --- a/dyld/unit-tests/test-cases/dlopen-executable/main.c +++ b/dyld/unit-tests/test-cases/dlopen-executable/main.c @@ -28,7 +28,8 @@ typedef int (*fooproc)(void); -int main() +int +main (void) { // dlopen of regular executable should fail void* handle = dlopen("./foo.exe", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/foo.c b/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/foo.c index fea884b9..b6b2c589 100644 --- a/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/main.c b/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/main.c index e208e146..c9b8cede 100644 --- a/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/main.c +++ b/dyld/unit-tests/test-cases/dlopen-from-anonymous-code/main.c @@ -48,7 +48,8 @@ void* calldlopen(const char* path, int mode, void* (*dlopen_proc)(const char* pa // // try calling dlopen() from code not owned by dyld // -int main() +int +main (void) { // now try to create a page where foo() was vm_address_t addr = 0; diff --git a/dyld/unit-tests/test-cases/dlopen-in-initializer/main.c b/dyld/unit-tests/test-cases/dlopen-in-initializer/main.c index bdc6dcf2..accddfbc 100644 --- a/dyld/unit-tests/test-cases/dlopen-in-initializer/main.c +++ b/dyld/unit-tests/test-cases/dlopen-in-initializer/main.c @@ -57,7 +57,8 @@ static void trySO(const char* path) -int main() +int +main (void) { trySO("test.bundle"); trySO("test.dylib"); diff --git a/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/bar.c b/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/bar.c index e4259998..7572dde3 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/foo.c b/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/foo.c index edbdbc46..df10c370 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-init-dlopen-notify/foo.c @@ -25,7 +25,8 @@ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/bar.c b/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/bar.c index 15b13278..395c7681 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/bar.c @@ -2,4 +2,5 @@ extern int foo(); -int bar() { return foo(); } +int +bar (void) { return foo(); } diff --git a/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/main.c b/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/main.c index d9a2c703..41e6c1fa 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/main.c +++ b/dyld/unit-tests/test-cases/dlopen-init-dlopen-up/main.c @@ -51,7 +51,8 @@ static void trySO(const char* path) -int main() +int +main (void) { trySO("libfoo.dylib"); diff --git a/dyld/unit-tests/test-cases/dlopen-init-dlopen/bar.c b/dyld/unit-tests/test-cases/dlopen-init-dlopen/bar.c index e4259998..7572dde3 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-dlopen/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-init-dlopen/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/dyld/unit-tests/test-cases/dlopen-init-dlopen/main.c b/dyld/unit-tests/test-cases/dlopen-init-dlopen/main.c index 9f1c5fbc..b6104e4c 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-dlopen/main.c +++ b/dyld/unit-tests/test-cases/dlopen-init-dlopen/main.c @@ -57,7 +57,8 @@ static void trySO(const char* path) -int main() +int +main (void) { trySO("libfoo.dylib"); diff --git a/dyld/unit-tests/test-cases/dlopen-init-up/bar.c b/dyld/unit-tests/test-cases/dlopen-init-up/bar.c index 15b13278..395c7681 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-up/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-init-up/bar.c @@ -2,4 +2,5 @@ extern int foo(); -int bar() { return foo(); } +int +bar (void) { return foo(); } diff --git a/dyld/unit-tests/test-cases/dlopen-init-up/main.c b/dyld/unit-tests/test-cases/dlopen-init-up/main.c index abdd5f16..bb9940a8 100644 --- a/dyld/unit-tests/test-cases/dlopen-init-up/main.c +++ b/dyld/unit-tests/test-cases/dlopen-init-up/main.c @@ -26,7 +26,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int main() +int +main (void) { PASS("dlopen-init-up"); return EXIT_SUCCESS; diff --git a/dyld/unit-tests/test-cases/dlopen-initializer/bar.c b/dyld/unit-tests/test-cases/dlopen-initializer/bar.c index e055874b..03f2ccf6 100644 --- a/dyld/unit-tests/test-cases/dlopen-initializer/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-initializer/bar.c @@ -25,12 +25,14 @@ static int initCount = 0; -void _init() +void +_init (void) { initCount++; } -int getInitCount() +int +getInitCount (void) { return initCount; } diff --git a/dyld/unit-tests/test-cases/dlopen-initializer/main.c b/dyld/unit-tests/test-cases/dlopen-initializer/main.c index 5dc4f2e2..eaa52a61 100644 --- a/dyld/unit-tests/test-cases/dlopen-initializer/main.c +++ b/dyld/unit-tests/test-cases/dlopen-initializer/main.c @@ -53,7 +53,8 @@ static void trySO(const char* path) -int main() +int +main (void) { trySO("test1.dylib"); trySO("test2.dylib"); diff --git a/dyld/unit-tests/test-cases/dlopen-leak-threaded/main.c b/dyld/unit-tests/test-cases/dlopen-leak-threaded/main.c index c1b3a371..14ea6f57 100644 --- a/dyld/unit-tests/test-cases/dlopen-leak-threaded/main.c +++ b/dyld/unit-tests/test-cases/dlopen-leak-threaded/main.c @@ -44,7 +44,8 @@ static void* work(void* arg) } -int main() +int +main (void) { pthread_t worker1; if ( pthread_create(&worker1, NULL, work, "/frazzle/bar") != 0 ) { diff --git a/dyld/unit-tests/test-cases/dlopen-leak/bar.c b/dyld/unit-tests/test-cases/dlopen-leak/bar.c index a48d74f2..c30be759 100644 --- a/dyld/unit-tests/test-cases/dlopen-leak/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-leak/bar.c @@ -1,6 +1,7 @@ #include -void bar() +void +bar (void) { strcpy(NULL, NULL); } diff --git a/dyld/unit-tests/test-cases/dlopen-leak/foo.c b/dyld/unit-tests/test-cases/dlopen-leak/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/dlopen-leak/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-leak/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/dlopen-leak/main.c b/dyld/unit-tests/test-cases/dlopen-leak/main.c index 3ff66e51..0b21ccc3 100644 --- a/dyld/unit-tests/test-cases/dlopen-leak/main.c +++ b/dyld/unit-tests/test-cases/dlopen-leak/main.c @@ -30,7 +30,8 @@ #include "test.h" -int main() +int +main (void) { for (int i=0; i < 100; ++i) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlopen-local-and-global/bar.c b/dyld/unit-tests/test-cases/dlopen-local-and-global/bar.c index e8e0806a..0fedb023 100644 --- a/dyld/unit-tests/test-cases/dlopen-local-and-global/bar.c +++ b/dyld/unit-tests/test-cases/dlopen-local-and-global/bar.c @@ -23,7 +23,8 @@ extern int foo; -int bar() +int +bar (void) { return foo; } diff --git a/dyld/unit-tests/test-cases/dlopen-multi/foo.c b/dyld/unit-tests/test-cases/dlopen-multi/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlopen-multi/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-multi/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlopen-multi/main.c b/dyld/unit-tests/test-cases/dlopen-multi/main.c index 180e91e0..5856725e 100644 --- a/dyld/unit-tests/test-cases/dlopen-multi/main.c +++ b/dyld/unit-tests/test-cases/dlopen-multi/main.c @@ -26,7 +26,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int main() +int +main (void) { void* handle1 = dlopen("test.bundle", RTLD_LAZY); void* handle2 = dlopen("test.bundle", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlopen-non-canonical-path/main.c b/dyld/unit-tests/test-cases/dlopen-non-canonical-path/main.c index 023c370f..2debaea2 100644 --- a/dyld/unit-tests/test-cases/dlopen-non-canonical-path/main.c +++ b/dyld/unit-tests/test-cases/dlopen-non-canonical-path/main.c @@ -46,7 +46,8 @@ static void tryPath(const char* path) // dlopen() not opening frameworks with non-canonical paths // -int main() +int +main (void) { tryPath("//usr/lib/libSystem.B.dylib"); tryPath("/usr/bin/../lib/libSystem.B.dylib"); diff --git a/dyld/unit-tests/test-cases/dlopen-notify-bind/foo.c b/dyld/unit-tests/test-cases/dlopen-notify-bind/foo.c index 8dab6be7..22f83529 100644 --- a/dyld/unit-tests/test-cases/dlopen-notify-bind/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-notify-bind/foo.c @@ -26,7 +26,8 @@ void* externalRlocToMalloc = &malloc; -void* foo() +void * +foo (void) { return externalRlocToMalloc; } diff --git a/dyld/unit-tests/test-cases/dlopen-notify-bind/main.c b/dyld/unit-tests/test-cases/dlopen-notify-bind/main.c index 630ba970..9dafe318 100644 --- a/dyld/unit-tests/test-cases/dlopen-notify-bind/main.c +++ b/dyld/unit-tests/test-cases/dlopen-notify-bind/main.c @@ -42,7 +42,8 @@ static void notify(const struct mach_header *mh, intptr_t vmaddr_slide) } -int main() +int +main (void) { _dyld_register_func_for_add_image(¬ify); diff --git a/dyld/unit-tests/test-cases/dlopen-search-leak/foo.c b/dyld/unit-tests/test-cases/dlopen-search-leak/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/dlopen-search-leak/foo.c +++ b/dyld/unit-tests/test-cases/dlopen-search-leak/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/dlopen-search-leak/main.c b/dyld/unit-tests/test-cases/dlopen-search-leak/main.c index 33c608be..ef0d59cf 100644 --- a/dyld/unit-tests/test-cases/dlopen-search-leak/main.c +++ b/dyld/unit-tests/test-cases/dlopen-search-leak/main.c @@ -30,7 +30,8 @@ #include "test.h" -int main() +int +main (void) { for (int i=0; i < 100; ++i) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/dlopen-zero/main.c b/dyld/unit-tests/test-cases/dlopen-zero/main.c index 81977a42..c5cdbb2a 100644 --- a/dyld/unit-tests/test-cases/dlopen-zero/main.c +++ b/dyld/unit-tests/test-cases/dlopen-zero/main.c @@ -27,13 +27,15 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int foo() +int +foo (void) { return 42; } -int main() +int +main (void) { // passing NULL as path to dlopen() has the special meaning of // "get handle to main executable" diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-basic/foo.c b/dyld/unit-tests/test-cases/dlopen_preflight-basic/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-basic/foo.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-basic/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-cycle/baz.c b/dyld/unit-tests/test-cases/dlopen_preflight-cycle/baz.c index 256a0e36..421abbc1 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-cycle/baz.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-cycle/baz.c @@ -1 +1,2 @@ -void baz() {} +void +baz (void) {} diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-cycle/foo.c b/dyld/unit-tests/test-cases/dlopen_preflight-cycle/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-cycle/foo.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-cycle/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/foo.c b/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/foo.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/main.c b/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/main.c index 48b5b72e..4261d022 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/main.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-leak-image-deny-single/main.c @@ -42,7 +42,8 @@ static const char* batchMappedHandler(enum dyld_image_states state, uint32_t inf } -int main() +int +main (void) { // tell dyld we want to know when images are mapped dyld_register_image_state_change_handler(dyld_image_state_mapped, false, batchMappedHandler); diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-leak/bar.c b/dyld/unit-tests/test-cases/dlopen_preflight-leak/bar.c index b72a1a51..86df6a12 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-leak/bar.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-leak/bar.c @@ -1,3 +1,4 @@ -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-leak/foo.c b/dyld/unit-tests/test-cases/dlopen_preflight-leak/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-leak/foo.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-leak/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/dlopen_preflight-leak/main.c b/dyld/unit-tests/test-cases/dlopen_preflight-leak/main.c index 09415970..dbcd2f69 100644 --- a/dyld/unit-tests/test-cases/dlopen_preflight-leak/main.c +++ b/dyld/unit-tests/test-cases/dlopen_preflight-leak/main.c @@ -30,7 +30,8 @@ #include "test.h" -int main() +int +main (void) { for (int i=0; i < 100; ++i) { dlopen_preflight("libfoo.dylib"); diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_DEFAULT/main.c b/dyld/unit-tests/test-cases/dlsym-RTLD_DEFAULT/main.c index ed3d8843..833a1831 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_DEFAULT/main.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_DEFAULT/main.c @@ -61,7 +61,8 @@ static void trySO(const char* path) -int main() +int +main (void) { trySO("test.bundle"); trySO("test.dylib"); diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/foo.c b/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/foo.c index a82c67df..7304a0b1 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/foo.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/foo.c @@ -22,12 +22,14 @@ */ -int foo() +int +foo (void) { return 10; } -int bar() +int +bar (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/main.c b/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/main.c index 65aacee0..ec8f89b7 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/main.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_MAIN_ONLY/main.c @@ -27,13 +27,15 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int foo() +int +foo (void) { return 0; } -int main() +int +main (void) { // make sure we get the foo() in main and not the one in libfoo.dylib if ( dlsym(RTLD_MAIN_ONLY, "foo") != &foo ) { diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo1.c b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo1.c index eda5424f..ddcbc0ed 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo1.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo1.c @@ -22,7 +22,8 @@ */ -int foo1() +int +foo1 (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo2.c b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo2.c index a17cf3d8..4cc95ffd 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo2.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo2.c @@ -22,7 +22,8 @@ */ -int foo2() +int +foo2 (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo3.c b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo3.c index 923e3638..f223739e 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo3.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/foo3.c @@ -22,7 +22,8 @@ */ -int foo3() +int +foo3 (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/main.c b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/main.c index 914cca62..eabef3d1 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/main.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT-missing/main.c @@ -35,7 +35,8 @@ -int main() +int +main (void) { dlsym(RTLD_NEXT, "bar"); return EXIT_SUCCESS; diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/foo.c b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/foo.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/main.c b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/main.c index 5c1064b0..cc15a635 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/main.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/main.c @@ -37,7 +37,8 @@ /// -int foo() +int +foo (void) { return 0; } @@ -83,7 +84,8 @@ static void trySO(const char* pathToLoad, const char* indirectLibrary) -int main() +int +main (void) { trySO("test.bundle", "foo1.dylib"); trySO("test.dylib", "foo2.dylib"); diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/test.c b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/test.c index 0d4b4638..547948e0 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/test.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_NEXT/test.c @@ -25,12 +25,14 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -void* test() +void * +test (void) { return dlsym(RTLD_NEXT, "foo"); } -int foo() +int +foo (void) { return 2; } \ No newline at end of file diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/foo.c b/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/foo.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/main.c b/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/main.c index 8c137c6e..675693a4 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/main.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/main.c @@ -38,7 +38,8 @@ /// -int foo() +int +foo (void) { return 0; } @@ -64,7 +65,8 @@ static void trySO(const char* pathToLoad) -int main() +int +main (void) { trySO("test.bundle"); trySO("test.dylib"); diff --git a/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/test.c b/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/test.c index b4ae9412..8248c7c7 100644 --- a/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/test.c +++ b/dyld/unit-tests/test-cases/dlsym-RTLD_SELF/test.c @@ -26,12 +26,14 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int foo() +int +foo (void) { return 2; } -void test() +void +test (void) { #ifdef RTLD_SELF if ( dlsym(RTLD_SELF, "foo") != &foo ) diff --git a/dyld/unit-tests/test-cases/dlsym-error/main.c b/dyld/unit-tests/test-cases/dlsym-error/main.c index cb4a9d66..43242653 100644 --- a/dyld/unit-tests/test-cases/dlsym-error/main.c +++ b/dyld/unit-tests/test-cases/dlsym-error/main.c @@ -28,13 +28,15 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int foo() +int +foo (void) { return 42; } -int main() +int +main (void) { void* handle = (void*)0x12345; // bogus value diff --git a/dyld/unit-tests/test-cases/dlsym-indirect/foo.c b/dyld/unit-tests/test-cases/dlsym-indirect/foo.c index 81f7dcfc..dd630188 100644 --- a/dyld/unit-tests/test-cases/dlsym-indirect/foo.c +++ b/dyld/unit-tests/test-cases/dlsym-indirect/foo.c @@ -22,7 +22,8 @@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-indirect/foo1.c b/dyld/unit-tests/test-cases/dlsym-indirect/foo1.c index eda5424f..ddcbc0ed 100644 --- a/dyld/unit-tests/test-cases/dlsym-indirect/foo1.c +++ b/dyld/unit-tests/test-cases/dlsym-indirect/foo1.c @@ -22,7 +22,8 @@ */ -int foo1() +int +foo1 (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-indirect/foo2.c b/dyld/unit-tests/test-cases/dlsym-indirect/foo2.c index a17cf3d8..4cc95ffd 100644 --- a/dyld/unit-tests/test-cases/dlsym-indirect/foo2.c +++ b/dyld/unit-tests/test-cases/dlsym-indirect/foo2.c @@ -22,7 +22,8 @@ */ -int foo2() +int +foo2 (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dlsym-indirect/foo3.c b/dyld/unit-tests/test-cases/dlsym-indirect/foo3.c index 923e3638..f223739e 100644 --- a/dyld/unit-tests/test-cases/dlsym-indirect/foo3.c +++ b/dyld/unit-tests/test-cases/dlsym-indirect/foo3.c @@ -22,7 +22,8 @@ */ -int foo3() +int +foo3 (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/dtrace-static-probes/main.c b/dyld/unit-tests/test-cases/dtrace-static-probes/main.c index 851bb338..b3c40ace 100644 --- a/dyld/unit-tests/test-cases/dtrace-static-probes/main.c +++ b/dyld/unit-tests/test-cases/dtrace-static-probes/main.c @@ -4,7 +4,8 @@ #include "foo.h" -int main() { +int +main (void) { for (int i=0; i < 5; ++i) { FOO_COUNT(i); } diff --git a/dyld/unit-tests/test-cases/dyld-func-lookup/main.c b/dyld/unit-tests/test-cases/dyld-func-lookup/main.c index 35bbd9ff..48091ec1 100644 --- a/dyld/unit-tests/test-cases/dyld-func-lookup/main.c +++ b/dyld/unit-tests/test-cases/dyld-func-lookup/main.c @@ -60,7 +60,8 @@ static void trySO(const char* path) #endif -int main() +int +main (void) { // _dyld_func_lookup is only available in 10.5 and earlier #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED <= __MAC_10_5) diff --git a/dyld/unit-tests/test-cases/env-DYLD_FALLBACK_LIBRARY_PATH/compress.c b/dyld/unit-tests/test-cases/env-DYLD_FALLBACK_LIBRARY_PATH/compress.c index b45d6131..28a06012 100644 --- a/dyld/unit-tests/test-cases/env-DYLD_FALLBACK_LIBRARY_PATH/compress.c +++ b/dyld/unit-tests/test-cases/env-DYLD_FALLBACK_LIBRARY_PATH/compress.c @@ -1,4 +1,5 @@ -int compress() +int +compress (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/executable-image-index/foo.c b/dyld/unit-tests/test-cases/executable-image-index/foo.c index 83c0b65e..662e8435 100644 --- a/dyld/unit-tests/test-cases/executable-image-index/foo.c +++ b/dyld/unit-tests/test-cases/executable-image-index/foo.c @@ -1,2 +1,3 @@ -void foo() { } +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/executable-image-index/main.c b/dyld/unit-tests/test-cases/executable-image-index/main.c index 315ea8e5..43257862 100644 --- a/dyld/unit-tests/test-cases/executable-image-index/main.c +++ b/dyld/unit-tests/test-cases/executable-image-index/main.c @@ -34,7 +34,8 @@ extern const struct mach_header __dso_handle; -int main() +int +main (void) { if ( _dyld_get_image_header(0) == &__dso_handle ) PASS("executable-image-index"); diff --git a/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/bar.c b/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/bar.c index b4415f85..db15a378 100644 --- a/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/bar.c +++ b/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/bar.c @@ -24,7 +24,8 @@ extern int foo(); -int bar() +int +bar (void) { return foo(); } diff --git a/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/foo.c b/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/foo.c index 9644c235..f8b32a3b 100644 --- a/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/foo.c +++ b/dyld/unit-tests/test-cases/fallback-non-unique-leaf-names/foo.c @@ -22,7 +22,8 @@ */ #include -int foo() +int +foo (void) { return FOO; } diff --git a/dyld/unit-tests/test-cases/fallback-with-suid/foo.c b/dyld/unit-tests/test-cases/fallback-with-suid/foo.c index 4ecb9310..4d4b27eb 100644 --- a/dyld/unit-tests/test-cases/fallback-with-suid/foo.c +++ b/dyld/unit-tests/test-cases/fallback-with-suid/foo.c @@ -21,5 +21,6 @@ * @APPLE_LICENSE_HEADER_END@ */ -void compress() {} +void +compress (void) {} diff --git a/dyld/unit-tests/test-cases/flat-data/getbar.c b/dyld/unit-tests/test-cases/flat-data/getbar.c index 020d7ad2..bc63b905 100644 --- a/dyld/unit-tests/test-cases/flat-data/getbar.c +++ b/dyld/unit-tests/test-cases/flat-data/getbar.c @@ -23,7 +23,8 @@ extern int bar; -int* getbar() +int * +getbar (void) { return &bar; } diff --git a/dyld/unit-tests/test-cases/flat-data/main.c b/dyld/unit-tests/test-cases/flat-data/main.c index fc85a6e5..b22e462d 100644 --- a/dyld/unit-tests/test-cases/flat-data/main.c +++ b/dyld/unit-tests/test-cases/flat-data/main.c @@ -34,7 +34,8 @@ extern int* getbar(); int bar = 1; -int main() +int +main (void) { if ( getbar() != &bar ) FAIL("flat-data found wrong bar"); diff --git a/dyld/unit-tests/test-cases/flat-insert/foo.c b/dyld/unit-tests/test-cases/flat-insert/foo.c index 2d68edf3..5e9c5361 100644 --- a/dyld/unit-tests/test-cases/flat-insert/foo.c +++ b/dyld/unit-tests/test-cases/flat-insert/foo.c @@ -23,7 +23,8 @@ #include -int foo() +int +foo (void) { return 42; } diff --git a/dyld/unit-tests/test-cases/flat-insert/main.c b/dyld/unit-tests/test-cases/flat-insert/main.c index 14cb600f..c9047df8 100644 --- a/dyld/unit-tests/test-cases/flat-insert/main.c +++ b/dyld/unit-tests/test-cases/flat-insert/main.c @@ -38,7 +38,8 @@ int main(int argc, const char* argv[]) // inserted library has another copy of foo() that should // override this one and return 42 -int foo() +int +foo (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/flat-prebound/bar.c b/dyld/unit-tests/test-cases/flat-prebound/bar.c index e12bfce1..c39c32ef 100644 --- a/dyld/unit-tests/test-cases/flat-prebound/bar.c +++ b/dyld/unit-tests/test-cases/flat-prebound/bar.c @@ -23,7 +23,8 @@ #include -int bar() +int +bar (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/flat-prebound/main.c b/dyld/unit-tests/test-cases/flat-prebound/main.c index 54862f4a..cc5c4aed 100644 --- a/dyld/unit-tests/test-cases/flat-prebound/main.c +++ b/dyld/unit-tests/test-cases/flat-prebound/main.c @@ -31,7 +31,8 @@ // but the bar in this main executable should override the prebound bar extern bool foo(); -int main() +int +main (void) { if ( foo() ) PASS("flat-prebound"); @@ -42,7 +43,8 @@ int main() } -int bar() +int +bar (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/flat-private-extern/foo.c b/dyld/unit-tests/test-cases/flat-private-extern/foo.c index ed6fc9b0..1b1eb726 100644 --- a/dyld/unit-tests/test-cases/flat-private-extern/foo.c +++ b/dyld/unit-tests/test-cases/flat-private-extern/foo.c @@ -23,7 +23,8 @@ extern int bar(); -int foo() +int +foo (void) { return bar(); } diff --git a/dyld/unit-tests/test-cases/flat-private-extern/main.c b/dyld/unit-tests/test-cases/flat-private-extern/main.c index 6505066a..0f5d828b 100644 --- a/dyld/unit-tests/test-cases/flat-private-extern/main.c +++ b/dyld/unit-tests/test-cases/flat-private-extern/main.c @@ -32,7 +32,8 @@ extern int foo(); -int main() +int +main (void) { if ( foo() == 0 ) FAIL("flat-private-extern found wrong bar"); @@ -42,7 +43,8 @@ int main() return EXIT_SUCCESS; } -int bar() +int +bar (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/framework-DYLD_LIBRARY_PATH/foo.c b/dyld/unit-tests/test-cases/framework-DYLD_LIBRARY_PATH/foo.c index 01c576d9..d1553269 100644 --- a/dyld/unit-tests/test-cases/framework-DYLD_LIBRARY_PATH/foo.c +++ b/dyld/unit-tests/test-cases/framework-DYLD_LIBRARY_PATH/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return RESULT; } diff --git a/dyld/unit-tests/test-cases/ignore-bad-files/foo.c b/dyld/unit-tests/test-cases/ignore-bad-files/foo.c index 4315d22b..2b051945 100644 --- a/dyld/unit-tests/test-cases/ignore-bad-files/foo.c +++ b/dyld/unit-tests/test-cases/ignore-bad-files/foo.c @@ -20,4 +20,5 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-count/foo.c b/dyld/unit-tests/test-cases/image-count/foo.c index c1f5255b..0d5ba3d9 100644 --- a/dyld/unit-tests/test-cases/image-count/foo.c +++ b/dyld/unit-tests/test-cases/image-count/foo.c @@ -1,2 +1,3 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-count/main.c b/dyld/unit-tests/test-cases/image-count/main.c index 06740b9d..a37f4157 100644 --- a/dyld/unit-tests/test-cases/image-count/main.c +++ b/dyld/unit-tests/test-cases/image-count/main.c @@ -31,7 +31,8 @@ extern struct mach_header __dso_handle; -struct dyld_all_image_infos* getImageInfosFromKernel() +struct dyld_all_image_infos * +getImageInfosFromKernel (void) { task_dyld_info_data_t task_dyld_info; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; @@ -44,8 +45,8 @@ struct dyld_all_image_infos* getImageInfosFromKernel() } -int -main() +int +main (void) { struct dyld_all_image_infos* info = getImageInfosFromKernel(); if ( info->version < 10 ) { diff --git a/dyld/unit-tests/test-cases/image-remove-crash/foo.c b/dyld/unit-tests/test-cases/image-remove-crash/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-remove-crash/foo.c +++ b/dyld/unit-tests/test-cases/image-remove-crash/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-remove-notification/foo.c b/dyld/unit-tests/test-cases/image-remove-notification/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-remove-notification/foo.c +++ b/dyld/unit-tests/test-cases/image-remove-notification/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-slide/foo.c b/dyld/unit-tests/test-cases/image-slide/foo.c index c1f5255b..0d5ba3d9 100644 --- a/dyld/unit-tests/test-cases/image-slide/foo.c +++ b/dyld/unit-tests/test-cases/image-slide/foo.c @@ -1,2 +1,3 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-slide/main.c b/dyld/unit-tests/test-cases/image-slide/main.c index f4fb3189..196f4b2a 100644 --- a/dyld/unit-tests/test-cases/image-slide/main.c +++ b/dyld/unit-tests/test-cases/image-slide/main.c @@ -41,8 +41,8 @@ intptr_t findSlide(const struct mach_header* mh) } -int -main() +int +main (void) { // find mach_header for libfoo.dylib const struct mach_header* mh; diff --git a/dyld/unit-tests/test-cases/image-state-change/foo.c b/dyld/unit-tests/test-cases/image-state-change/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-state-change/foo.c +++ b/dyld/unit-tests/test-cases/image-state-change/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-state-change/main.c b/dyld/unit-tests/test-cases/image-state-change/main.c index 6ee6a622..6aa0de88 100644 --- a/dyld/unit-tests/test-cases/image-state-change/main.c +++ b/dyld/unit-tests/test-cases/image-state-change/main.c @@ -79,7 +79,8 @@ static const char* singleUnmappedHandler(enum dyld_image_states state, uint32_t return NULL; } -static void loadAndUnLoad() +static void +loadAndUnLoad (void) { void* handle = dlopen("foo.bundle", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/image-state-deny-OFI/foo.c b/dyld/unit-tests/test-cases/image-state-deny-OFI/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-state-deny-OFI/foo.c +++ b/dyld/unit-tests/test-cases/image-state-deny-OFI/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-state-deny-all_image_infos/bar.c b/dyld/unit-tests/test-cases/image-state-deny-all_image_infos/bar.c index e4259998..7572dde3 100644 --- a/dyld/unit-tests/test-cases/image-state-deny-all_image_infos/bar.c +++ b/dyld/unit-tests/test-cases/image-state-deny-all_image_infos/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/dyld/unit-tests/test-cases/image-state-deny-cache-leak/bar.c b/dyld/unit-tests/test-cases/image-state-deny-cache-leak/bar.c index 30ade8f7..fdcfae7f 100644 --- a/dyld/unit-tests/test-cases/image-state-deny-cache-leak/bar.c +++ b/dyld/unit-tests/test-cases/image-state-deny-cache-leak/bar.c @@ -1,2 +1,3 @@ -void bar() { } +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/image-state-deny-cache-leak/foo.c b/dyld/unit-tests/test-cases/image-state-deny-cache-leak/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-state-deny-cache-leak/foo.c +++ b/dyld/unit-tests/test-cases/image-state-deny-cache-leak/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-state-deny-dlclose/foo.c b/dyld/unit-tests/test-cases/image-state-deny-dlclose/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-state-deny-dlclose/foo.c +++ b/dyld/unit-tests/test-cases/image-state-deny-dlclose/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-state-deny-leak/bar.c b/dyld/unit-tests/test-cases/image-state-deny-leak/bar.c index 30ade8f7..fdcfae7f 100644 --- a/dyld/unit-tests/test-cases/image-state-deny-leak/bar.c +++ b/dyld/unit-tests/test-cases/image-state-deny-leak/bar.c @@ -1,2 +1,3 @@ -void bar() { } +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/image-state-deny-leak/foo.c b/dyld/unit-tests/test-cases/image-state-deny-leak/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-state-deny-leak/foo.c +++ b/dyld/unit-tests/test-cases/image-state-deny-leak/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-state-deny/foo.c b/dyld/unit-tests/test-cases/image-state-deny/foo.c index 6924ac69..7ef0f0ec 100644 --- a/dyld/unit-tests/test-cases/image-state-deny/foo.c +++ b/dyld/unit-tests/test-cases/image-state-deny/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image-suffix/foo.c b/dyld/unit-tests/test-cases/image-suffix/foo.c index a267f20e..5fba618e 100644 --- a/dyld/unit-tests/test-cases/image-suffix/foo.c +++ b/dyld/unit-tests/test-cases/image-suffix/foo.c @@ -22,7 +22,8 @@ */ #include -void foo() +void +foo (void) { printf("foo"); } diff --git a/dyld/unit-tests/test-cases/image_path_containing_address/foo.c b/dyld/unit-tests/test-cases/image_path_containing_address/foo.c index 85e6cd8c..4c76cef7 100644 --- a/dyld/unit-tests/test-cases/image_path_containing_address/foo.c +++ b/dyld/unit-tests/test-cases/image_path_containing_address/foo.c @@ -1 +1,2 @@ -void foo() {} +void +foo (void) {} diff --git a/dyld/unit-tests/test-cases/image_path_containing_address/main.c b/dyld/unit-tests/test-cases/image_path_containing_address/main.c index 2025b1d4..6bbb2287 100644 --- a/dyld/unit-tests/test-cases/image_path_containing_address/main.c +++ b/dyld/unit-tests/test-cases/image_path_containing_address/main.c @@ -49,7 +49,8 @@ static void verify(void* addr) } -int main() +int +main (void) { verify(&main); verify(&foo); diff --git a/dyld/unit-tests/test-cases/init-libSystem-first/main.c b/dyld/unit-tests/test-cases/init-libSystem-first/main.c index 28a4db3d..9fe374ff 100644 --- a/dyld/unit-tests/test-cases/init-libSystem-first/main.c +++ b/dyld/unit-tests/test-cases/init-libSystem-first/main.c @@ -28,7 +28,8 @@ extern bool foo(); -int main() +int +main (void) { if ( foo() ) PASS("init-libSystem-first"); diff --git a/dyld/unit-tests/test-cases/init-order/base.c b/dyld/unit-tests/test-cases/init-order/base.c index 2cdb40a9..2870ebf5 100644 --- a/dyld/unit-tests/test-cases/init-order/base.c +++ b/dyld/unit-tests/test-cases/init-order/base.c @@ -39,7 +39,8 @@ void setState(int nextState) } -void baseCheck() +void +baseCheck (void) { if ( badOrder ) { switch ( state ) { diff --git a/dyld/unit-tests/test-cases/init-order/main.c b/dyld/unit-tests/test-cases/init-order/main.c index b210384c..34ffa17d 100644 --- a/dyld/unit-tests/test-cases/init-order/main.c +++ b/dyld/unit-tests/test-cases/init-order/main.c @@ -28,7 +28,8 @@ #include "base.h" -int main() +int +main (void) { baseCheck(); return EXIT_SUCCESS; diff --git a/dyld/unit-tests/test-cases/initializer-bounds-check/bar.c b/dyld/unit-tests/test-cases/initializer-bounds-check/bar.c index 12846f37..51870f99 100644 --- a/dyld/unit-tests/test-cases/initializer-bounds-check/bar.c +++ b/dyld/unit-tests/test-cases/initializer-bounds-check/bar.c @@ -1,7 +1,8 @@ int bar = 0; -void altSecondInit() +void +altSecondInit (void) { bar = 1; } diff --git a/dyld/unit-tests/test-cases/initializer-bounds-check/main.c b/dyld/unit-tests/test-cases/initializer-bounds-check/main.c index bd4a512b..947942d2 100644 --- a/dyld/unit-tests/test-cases/initializer-bounds-check/main.c +++ b/dyld/unit-tests/test-cases/initializer-bounds-check/main.c @@ -27,8 +27,8 @@ extern int bar; -int -main() +int +main (void) { if ( bar == 1 ) FAIL("initializer-bounds-check, out of bounds initializer called"); diff --git a/dyld/unit-tests/test-cases/interpose-basic-prebound/main.c b/dyld/unit-tests/test-cases/interpose-basic-prebound/main.c index ba5a95ce..a9d96ca0 100644 --- a/dyld/unit-tests/test-cases/interpose-basic-prebound/main.c +++ b/dyld/unit-tests/test-cases/interpose-basic-prebound/main.c @@ -30,7 +30,8 @@ extern bool check_dylib_interposing(); -int main() +int +main (void) { if ( check_dylib_interposing() ) PASS("interpose-basic"); diff --git a/dyld/unit-tests/test-cases/interpose-basic/main.c b/dyld/unit-tests/test-cases/interpose-basic/main.c index ebcd7417..c1128ba4 100644 --- a/dyld/unit-tests/test-cases/interpose-basic/main.c +++ b/dyld/unit-tests/test-cases/interpose-basic/main.c @@ -29,7 +29,8 @@ extern char* wrap_strdup(const char*); -int main() +int +main (void) { const char* x = strdup("123"); const char* y = wrap_strdup("456"); diff --git a/dyld/unit-tests/test-cases/interpose-chained/main.c b/dyld/unit-tests/test-cases/interpose-chained/main.c index 5209b67f..acbb1477 100644 --- a/dyld/unit-tests/test-cases/interpose-chained/main.c +++ b/dyld/unit-tests/test-cases/interpose-chained/main.c @@ -27,7 +27,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() #include "foo.h" -int main() +int +main (void) { const char* x = foo("seed"); diff --git a/dyld/unit-tests/test-cases/interpose-dlsym/main.c b/dyld/unit-tests/test-cases/interpose-dlsym/main.c index 68577102..b8f15d75 100644 --- a/dyld/unit-tests/test-cases/interpose-dlsym/main.c +++ b/dyld/unit-tests/test-cases/interpose-dlsym/main.c @@ -29,7 +29,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() -int main() +int +main (void) { void* handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/interpose-dynamic-basic/main.c b/dyld/unit-tests/test-cases/interpose-dynamic-basic/main.c index b3025126..16f23333 100644 --- a/dyld/unit-tests/test-cases/interpose-dynamic-basic/main.c +++ b/dyld/unit-tests/test-cases/interpose-dynamic-basic/main.c @@ -40,7 +40,8 @@ char* mystrdup(const char* in) static const struct dyld_interpose_tuple sTable[] = { {&mystrdup, &strdup} }; -int main() +int +main (void) { const char* preCall = strdup("123"); DupProc preProc = &strdup; diff --git a/dyld/unit-tests/test-cases/interpose-dynamic-dlsym/main.c b/dyld/unit-tests/test-cases/interpose-dynamic-dlsym/main.c index da21a5ca..df773f33 100644 --- a/dyld/unit-tests/test-cases/interpose-dynamic-dlsym/main.c +++ b/dyld/unit-tests/test-cases/interpose-dynamic-dlsym/main.c @@ -30,7 +30,8 @@ typedef int (*FooProc)(); -int main() +int +main (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/interpose-dynamic-lazy/main.c b/dyld/unit-tests/test-cases/interpose-dynamic-lazy/main.c index 89e9ad92..688e29a8 100644 --- a/dyld/unit-tests/test-cases/interpose-dynamic-lazy/main.c +++ b/dyld/unit-tests/test-cases/interpose-dynamic-lazy/main.c @@ -30,7 +30,8 @@ extern int foo(); -int main() +int +main (void) { int result = foo(); if ( result == 10 ) diff --git a/dyld/unit-tests/test-cases/interpose-multiple/base.c b/dyld/unit-tests/test-cases/interpose-multiple/base.c index 126f99ec..ac4fe537 100644 --- a/dyld/unit-tests/test-cases/interpose-multiple/base.c +++ b/dyld/unit-tests/test-cases/interpose-multiple/base.c @@ -1,6 +1,8 @@ #include #include "base.h" -int base1() { return 1; } -int base2() { return 2; } +int +base1 (void) { return 1; } +int +base2 (void) { return 2; } diff --git a/dyld/unit-tests/test-cases/interpose-multiple/main.c b/dyld/unit-tests/test-cases/interpose-multiple/main.c index e0bd1d1c..118b89de 100644 --- a/dyld/unit-tests/test-cases/interpose-multiple/main.c +++ b/dyld/unit-tests/test-cases/interpose-multiple/main.c @@ -27,7 +27,8 @@ #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() #include "base.h" -int main() +int +main (void) { return EXIT_SUCCESS; } diff --git a/dyld/unit-tests/test-cases/interpose-shared-cache/main.c b/dyld/unit-tests/test-cases/interpose-shared-cache/main.c index 93ef8980..e6939c7e 100644 --- a/dyld/unit-tests/test-cases/interpose-shared-cache/main.c +++ b/dyld/unit-tests/test-cases/interpose-shared-cache/main.c @@ -31,7 +31,8 @@ extern bool allocationSeen(void* p); typedef bool (*seenProc)(void*); -int main() +int +main (void) { void* x = strdup("123"); diff --git a/dyld/unit-tests/test-cases/jump-table-dynamic-lookup/main.c b/dyld/unit-tests/test-cases/jump-table-dynamic-lookup/main.c index 6325af75..c6d17103 100644 --- a/dyld/unit-tests/test-cases/jump-table-dynamic-lookup/main.c +++ b/dyld/unit-tests/test-cases/jump-table-dynamic-lookup/main.c @@ -65,7 +65,8 @@ static void* callAll(void* p) return NULL; } -int main() +int +main (void) { // load libfoo so that functions can be found dynamically dlopen("libfoo.dylib", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/jump-table-race/main.c b/dyld/unit-tests/test-cases/jump-table-race/main.c index 202fe28b..807b9d8a 100644 --- a/dyld/unit-tests/test-cases/jump-table-race/main.c +++ b/dyld/unit-tests/test-cases/jump-table-race/main.c @@ -849,7 +849,8 @@ static void* callAll(void* p) return NULL; } -int main() +int +main (void) { // call all foo's on another thread pthread_t otherThread; diff --git a/dyld/unit-tests/test-cases/lazy-binding-reg-params/main.c b/dyld/unit-tests/test-cases/lazy-binding-reg-params/main.c index fc66bd17..8b131835 100644 --- a/dyld/unit-tests/test-cases/lazy-binding-reg-params/main.c +++ b/dyld/unit-tests/test-cases/lazy-binding-reg-params/main.c @@ -80,7 +80,8 @@ static bool vectortest() } #endif -int main() +int +main (void) { if ( ! inttest() ) { FAIL("lazy-binding-reg-params int parameters"); diff --git a/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/foo.c b/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/foo.c index f41dbba7..23238e63 100644 --- a/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/foo.c +++ b/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/foo.c @@ -1,6 +1,7 @@ -int foo() +int +foo (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/main.c b/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/main.c index 9ff00323..1b058dd7 100644 --- a/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/main.c +++ b/dyld/unit-tests/test-cases/lazy-dylib-missing-dylib/main.c @@ -32,7 +32,8 @@ // then when binding lazy symbols, if one // cannot be bound, it is bound to this function // instead. -int dyld_lazy_dylib_proxy() +int +dyld_lazy_dylib_proxy (void) { return 7; } @@ -41,7 +42,8 @@ int dyld_lazy_dylib_proxy() extern int foo(); // should not exist -int main() +int +main (void) { #if LAZY_HANDLER // sanity check that foo was not found diff --git a/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/foo.c b/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/foo.c index 2c56b398..33dd6153 100644 --- a/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/foo.c +++ b/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/foo.c @@ -1,12 +1,14 @@ -int foo() +int +foo (void) { return 1; } #if BAR -int bar() +int +bar (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/main.c b/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/main.c index 934e48ac..7c04aa31 100644 --- a/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/main.c +++ b/dyld/unit-tests/test-cases/lazy-dylib-missing-symbol/main.c @@ -32,7 +32,8 @@ // then when binding lazy symbols, if one // cannot be bound, it is bound to this function // instead. -int dyld_lazy_dylib_proxy() +int +dyld_lazy_dylib_proxy (void) { return 7; } @@ -42,7 +43,8 @@ int dyld_lazy_dylib_proxy() extern int foo(); // should exist extern int bar(); // should not exist -int main() +int +main (void) { // sanity check that foo was found if ( foo() != 1 ) { diff --git a/dyld/unit-tests/test-cases/lazy-pointer-binding/main.c b/dyld/unit-tests/test-cases/lazy-pointer-binding/main.c index c2554b27..577310d6 100644 --- a/dyld/unit-tests/test-cases/lazy-pointer-binding/main.c +++ b/dyld/unit-tests/test-cases/lazy-pointer-binding/main.c @@ -35,7 +35,8 @@ extern bool inttest(long long p1, long long p2, long long p3, long long p4, long -int main() +int +main (void) { if ( ! floattest(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0) ) { FAIL("lazy-pointer-binding float parameters"); diff --git a/dyld/unit-tests/test-cases/lib-name-overload/main.c b/dyld/unit-tests/test-cases/lib-name-overload/main.c index 73cc95af..a695fb53 100644 --- a/dyld/unit-tests/test-cases/lib-name-overload/main.c +++ b/dyld/unit-tests/test-cases/lib-name-overload/main.c @@ -33,7 +33,8 @@ extern int foo2; -int main() +int +main (void) { return foo2; } diff --git a/dyld/unit-tests/test-cases/loader_path-dup/main.c b/dyld/unit-tests/test-cases/loader_path-dup/main.c index 9c12ccca..4dab538e 100644 --- a/dyld/unit-tests/test-cases/loader_path-dup/main.c +++ b/dyld/unit-tests/test-cases/loader_path-dup/main.c @@ -30,7 +30,8 @@ extern bool foo(); extern bool bar(); -int main() +int +main (void) { if ( foo() && bar() ) PASS("loader_path"); diff --git a/dyld/unit-tests/test-cases/loader_path-symlink/bar.c b/dyld/unit-tests/test-cases/loader_path-symlink/bar.c index b72a1a51..86df6a12 100644 --- a/dyld/unit-tests/test-cases/loader_path-symlink/bar.c +++ b/dyld/unit-tests/test-cases/loader_path-symlink/bar.c @@ -1,3 +1,4 @@ -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/loader_path-symlink/foo.c b/dyld/unit-tests/test-cases/loader_path-symlink/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/loader_path-symlink/foo.c +++ b/dyld/unit-tests/test-cases/loader_path-symlink/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/loader_path-symlink/main.c b/dyld/unit-tests/test-cases/loader_path-symlink/main.c index 4c91a7c1..6890c8fc 100644 --- a/dyld/unit-tests/test-cases/loader_path-symlink/main.c +++ b/dyld/unit-tests/test-cases/loader_path-symlink/main.c @@ -6,7 +6,8 @@ extern void foo(); -int main() +int +main (void) { foo(); PASS("loader_path-symlink"); diff --git a/dyld/unit-tests/test-cases/loader_path/bar.c b/dyld/unit-tests/test-cases/loader_path/bar.c index 902e5635..185fc21d 100644 --- a/dyld/unit-tests/test-cases/loader_path/bar.c +++ b/dyld/unit-tests/test-cases/loader_path/bar.c @@ -20,4 +20,5 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void bar() {} +void +bar (void) {} diff --git a/dyld/unit-tests/test-cases/loader_path/foo.c b/dyld/unit-tests/test-cases/loader_path/foo.c index 1bcf3c22..294b2d58 100644 --- a/dyld/unit-tests/test-cases/loader_path/foo.c +++ b/dyld/unit-tests/test-cases/loader_path/foo.c @@ -20,6 +20,7 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/loader_path/main.c b/dyld/unit-tests/test-cases/loader_path/main.c index f8600b47..3d9fdd2f 100644 --- a/dyld/unit-tests/test-cases/loader_path/main.c +++ b/dyld/unit-tests/test-cases/loader_path/main.c @@ -29,7 +29,8 @@ #include "test.h" -int main() +int +main (void) { #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5) NSAddImage("@loader_path/hide/libfoo3.dylib", 0); diff --git a/dyld/unit-tests/test-cases/non-lazy-slide/foo.c b/dyld/unit-tests/test-cases/non-lazy-slide/foo.c index 1b2c9f73..569500fd 100644 --- a/dyld/unit-tests/test-cases/non-lazy-slide/foo.c +++ b/dyld/unit-tests/test-cases/non-lazy-slide/foo.c @@ -1,7 +1,8 @@ extern int bar; -int foo() +int +foo (void) { return bar; } diff --git a/dyld/unit-tests/test-cases/non-lazy-slide/main.c b/dyld/unit-tests/test-cases/non-lazy-slide/main.c index a73a1db0..7b512aa5 100644 --- a/dyld/unit-tests/test-cases/non-lazy-slide/main.c +++ b/dyld/unit-tests/test-cases/non-lazy-slide/main.c @@ -11,7 +11,8 @@ extern int foo(); -int main() +int +main (void) { if ( foo() == 10 ) PASS("non-lazy-slide"); diff --git a/dyld/unit-tests/test-cases/non-lazy-weak/foo.c b/dyld/unit-tests/test-cases/non-lazy-weak/foo.c index 1b2c9f73..569500fd 100644 --- a/dyld/unit-tests/test-cases/non-lazy-weak/foo.c +++ b/dyld/unit-tests/test-cases/non-lazy-weak/foo.c @@ -1,7 +1,8 @@ extern int bar; -int foo() +int +foo (void) { return bar; } diff --git a/dyld/unit-tests/test-cases/non-lazy-weak/main.c b/dyld/unit-tests/test-cases/non-lazy-weak/main.c index 16a78b70..b5e11a21 100644 --- a/dyld/unit-tests/test-cases/non-lazy-weak/main.c +++ b/dyld/unit-tests/test-cases/non-lazy-weak/main.c @@ -8,7 +8,8 @@ extern int foo(); -int main() +int +main (void) { if ( foo() == 10 ) PASS("non-lazy-weak"); diff --git a/dyld/unit-tests/test-cases/non-weak-library/foo.c b/dyld/unit-tests/test-cases/non-weak-library/foo.c index c57adba0..e8481128 100644 --- a/dyld/unit-tests/test-cases/non-weak-library/foo.c +++ b/dyld/unit-tests/test-cases/non-weak-library/foo.c @@ -20,7 +20,8 @@ * * @APPLE_LICENSE_HEADER_END@ */ -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/partial-library-load/bundle.c b/dyld/unit-tests/test-cases/partial-library-load/bundle.c index a7aad9e1..5a137447 100644 --- a/dyld/unit-tests/test-cases/partial-library-load/bundle.c +++ b/dyld/unit-tests/test-cases/partial-library-load/bundle.c @@ -22,7 +22,8 @@ */ extern int foo(); -void bun() +void +bun (void) { foo(); diff --git a/dyld/unit-tests/test-cases/partial-library-load/foo.c b/dyld/unit-tests/test-cases/partial-library-load/foo.c index 8abc708b..1fb8a437 100644 --- a/dyld/unit-tests/test-cases/partial-library-load/foo.c +++ b/dyld/unit-tests/test-cases/partial-library-load/foo.c @@ -27,7 +27,8 @@ extern int bar3; -int foo() +int +foo (void) { return bar1 + bar2 + bar3; } diff --git a/dyld/unit-tests/test-cases/partial-library-load/main.c b/dyld/unit-tests/test-cases/partial-library-load/main.c index 9993ac40..dc4c4982 100644 --- a/dyld/unit-tests/test-cases/partial-library-load/main.c +++ b/dyld/unit-tests/test-cases/partial-library-load/main.c @@ -27,7 +27,8 @@ #include "test.h" // PASS(), FAIL() -int main() +int +main (void) { // NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS #if __MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/dyld/unit-tests/test-cases/pie-basic/main.c b/dyld/unit-tests/test-cases/pie-basic/main.c index 3a6571d1..773b0ebb 100644 --- a/dyld/unit-tests/test-cases/pie-basic/main.c +++ b/dyld/unit-tests/test-cases/pie-basic/main.c @@ -23,7 +23,8 @@ #include #include -int main() +int +main (void) { //int local; diff --git a/dyld/unit-tests/test-cases/pie-big/main.c b/dyld/unit-tests/test-cases/pie-big/main.c index 49d9a882..787ea20f 100644 --- a/dyld/unit-tests/test-cases/pie-big/main.c +++ b/dyld/unit-tests/test-cases/pie-big/main.c @@ -34,7 +34,8 @@ char bigarray[0x10000000]; // 0.25GB #endif #endif -int main() +int +main (void) { //int local; diff --git a/dyld/unit-tests/test-cases/pie-custom-stack/main.c b/dyld/unit-tests/test-cases/pie-custom-stack/main.c index 3a6571d1..773b0ebb 100644 --- a/dyld/unit-tests/test-cases/pie-custom-stack/main.c +++ b/dyld/unit-tests/test-cases/pie-custom-stack/main.c @@ -23,7 +23,8 @@ #include #include -int main() +int +main (void) { //int local; diff --git a/dyld/unit-tests/test-cases/pie-dylib/foo.c b/dyld/unit-tests/test-cases/pie-dylib/foo.c index 0c9d0805..001a836c 100644 --- a/dyld/unit-tests/test-cases/pie-dylib/foo.c +++ b/dyld/unit-tests/test-cases/pie-dylib/foo.c @@ -1,7 +1,8 @@ #include #include -void foo() +void +foo (void) { printf("&foo=%p\n", &foo); } diff --git a/dyld/unit-tests/test-cases/pie-dylib/main.c b/dyld/unit-tests/test-cases/pie-dylib/main.c index d36c9b85..54743246 100644 --- a/dyld/unit-tests/test-cases/pie-dylib/main.c +++ b/dyld/unit-tests/test-cases/pie-dylib/main.c @@ -3,7 +3,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/dyld/unit-tests/test-cases/pie-text-reloc/main.c b/dyld/unit-tests/test-cases/pie-text-reloc/main.c index f1c8b858..d5208873 100644 --- a/dyld/unit-tests/test-cases/pie-text-reloc/main.c +++ b/dyld/unit-tests/test-cases/pie-text-reloc/main.c @@ -26,7 +26,8 @@ static int data=0; -int main() +int +main (void) { printf("&data=%p\n", &data); return 0; diff --git a/dyld/unit-tests/test-cases/pthread-keys/main.c b/dyld/unit-tests/test-cases/pthread-keys/main.c index e1832d8b..de1ca743 100644 --- a/dyld/unit-tests/test-cases/pthread-keys/main.c +++ b/dyld/unit-tests/test-cases/pthread-keys/main.c @@ -31,7 +31,8 @@ /// The key index for main executables starts at 4 /// -int main() +int +main (void) { pthread_key_t key; diff --git a/dyld/unit-tests/test-cases/re-export-dylib/bar.c b/dyld/unit-tests/test-cases/re-export-dylib/bar.c index b0faf2f0..e36f15a0 100644 --- a/dyld/unit-tests/test-cases/re-export-dylib/bar.c +++ b/dyld/unit-tests/test-cases/re-export-dylib/bar.c @@ -1,4 +1,5 @@ -int bar() +int +bar (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/re-export-dylib/foo.c b/dyld/unit-tests/test-cases/re-export-dylib/foo.c index 2486c7ae..a25681d0 100644 --- a/dyld/unit-tests/test-cases/re-export-dylib/foo.c +++ b/dyld/unit-tests/test-cases/re-export-dylib/foo.c @@ -1,4 +1,5 @@ -int foo() +int +foo (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/re-export-dylib/main.c b/dyld/unit-tests/test-cases/re-export-dylib/main.c index 2d54c745..b90547a3 100644 --- a/dyld/unit-tests/test-cases/re-export-dylib/main.c +++ b/dyld/unit-tests/test-cases/re-export-dylib/main.c @@ -30,7 +30,8 @@ extern int foo(); extern int bar(); -int main() +int +main (void) { foo(); bar(); diff --git a/dyld/unit-tests/test-cases/re-export-framework/bar.c b/dyld/unit-tests/test-cases/re-export-framework/bar.c index b0faf2f0..e36f15a0 100644 --- a/dyld/unit-tests/test-cases/re-export-framework/bar.c +++ b/dyld/unit-tests/test-cases/re-export-framework/bar.c @@ -1,4 +1,5 @@ -int bar() +int +bar (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/re-export-framework/foo.c b/dyld/unit-tests/test-cases/re-export-framework/foo.c index 2486c7ae..a25681d0 100644 --- a/dyld/unit-tests/test-cases/re-export-framework/foo.c +++ b/dyld/unit-tests/test-cases/re-export-framework/foo.c @@ -1,4 +1,5 @@ -int foo() +int +foo (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/re-export-framework/main.c b/dyld/unit-tests/test-cases/re-export-framework/main.c index 7ad3fed4..5736e10f 100644 --- a/dyld/unit-tests/test-cases/re-export-framework/main.c +++ b/dyld/unit-tests/test-cases/re-export-framework/main.c @@ -30,7 +30,8 @@ extern int foo(); extern int bar(); -int main() +int +main (void) { foo(); bar(); diff --git a/dyld/unit-tests/test-cases/re-export-sub-framework/bar.c b/dyld/unit-tests/test-cases/re-export-sub-framework/bar.c index b0faf2f0..e36f15a0 100644 --- a/dyld/unit-tests/test-cases/re-export-sub-framework/bar.c +++ b/dyld/unit-tests/test-cases/re-export-sub-framework/bar.c @@ -1,4 +1,5 @@ -int bar() +int +bar (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/re-export-sub-framework/foo.c b/dyld/unit-tests/test-cases/re-export-sub-framework/foo.c index 2486c7ae..a25681d0 100644 --- a/dyld/unit-tests/test-cases/re-export-sub-framework/foo.c +++ b/dyld/unit-tests/test-cases/re-export-sub-framework/foo.c @@ -1,4 +1,5 @@ -int foo() +int +foo (void) { return 0; } diff --git a/dyld/unit-tests/test-cases/re-export-sub-framework/main.c b/dyld/unit-tests/test-cases/re-export-sub-framework/main.c index fe2ae5e3..3199d56d 100644 --- a/dyld/unit-tests/test-cases/re-export-sub-framework/main.c +++ b/dyld/unit-tests/test-cases/re-export-sub-framework/main.c @@ -30,7 +30,8 @@ extern int foo(); extern int bar(); -int main() +int +main (void) { foo(); bar(); diff --git a/dyld/unit-tests/test-cases/re-export-symbol-dylib/baz.c b/dyld/unit-tests/test-cases/re-export-symbol-dylib/baz.c index cb308182..e6030433 100644 --- a/dyld/unit-tests/test-cases/re-export-symbol-dylib/baz.c +++ b/dyld/unit-tests/test-cases/re-export-symbol-dylib/baz.c @@ -1,4 +1,5 @@ -int baz() +int +baz (void) { return 3; } diff --git a/dyld/unit-tests/test-cases/re-export-symbol-dylib/frob.c b/dyld/unit-tests/test-cases/re-export-symbol-dylib/frob.c index 3df9d3d1..34a79a57 100644 --- a/dyld/unit-tests/test-cases/re-export-symbol-dylib/frob.c +++ b/dyld/unit-tests/test-cases/re-export-symbol-dylib/frob.c @@ -1,4 +1,5 @@ -int frob() +int +frob (void) { return 4; } diff --git a/dyld/unit-tests/test-cases/re-export-symbol-dylib/main.c b/dyld/unit-tests/test-cases/re-export-symbol-dylib/main.c index f12dd108..da26066c 100644 --- a/dyld/unit-tests/test-cases/re-export-symbol-dylib/main.c +++ b/dyld/unit-tests/test-cases/re-export-symbol-dylib/main.c @@ -18,7 +18,8 @@ int (*pbaz)() = &baz; int (*pfrob)() = &frob; -int main() +int +main (void) { if ( foo() != 1 ) FAIL("re-export-symbol-dylib: foo() returned wrong value"); diff --git a/dyld/unit-tests/test-cases/re-export-symbol/main1.c b/dyld/unit-tests/test-cases/re-export-symbol/main1.c index cd2bab72..df337ad3 100644 --- a/dyld/unit-tests/test-cases/re-export-symbol/main1.c +++ b/dyld/unit-tests/test-cases/re-export-symbol/main1.c @@ -10,7 +10,8 @@ extern int bar(); int (*pbar)() = &bar; -int main() +int +main (void) { if ( foo() != 10 ) FAIL("re-export-symbol: foo() returned wrong value"); diff --git a/dyld/unit-tests/test-cases/re-export-symbol/main2.c b/dyld/unit-tests/test-cases/re-export-symbol/main2.c index 7a11c927..f7b09f11 100644 --- a/dyld/unit-tests/test-cases/re-export-symbol/main2.c +++ b/dyld/unit-tests/test-cases/re-export-symbol/main2.c @@ -12,7 +12,8 @@ extern int mybar(); int (*pmybar)() = &mybar; -int main() +int +main (void) { if ( foo() != 10 ) FAIL("re-export-symbol: foo() returned wrong value"); diff --git a/dyld/unit-tests/test-cases/read-only-import-shared-cache-coalesce/main.c b/dyld/unit-tests/test-cases/read-only-import-shared-cache-coalesce/main.c index 4579fe46..a1ff1081 100644 --- a/dyld/unit-tests/test-cases/read-only-import-shared-cache-coalesce/main.c +++ b/dyld/unit-tests/test-cases/read-only-import-shared-cache-coalesce/main.c @@ -1,7 +1,8 @@ #include -int main() +int +main (void) { // dynamically load libfoo.dylib which depends on libstdc++.dylib // being re-bound to libfoo's operator new. diff --git a/dyld/unit-tests/test-cases/read-only-import-shared-cache-dlopen-override/main.c b/dyld/unit-tests/test-cases/read-only-import-shared-cache-dlopen-override/main.c index b3c927d5..4359b135 100644 --- a/dyld/unit-tests/test-cases/read-only-import-shared-cache-dlopen-override/main.c +++ b/dyld/unit-tests/test-cases/read-only-import-shared-cache-dlopen-override/main.c @@ -2,7 +2,8 @@ #include "test.h" -int main() +int +main (void) { // dynamically load libz.dylib which imports _malloc from libSystem dlopen("/usr/lib/libz.dylib", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/read-only-stubs/bar.c b/dyld/unit-tests/test-cases/read-only-stubs/bar.c index d9a1c202..605b0aa6 100644 --- a/dyld/unit-tests/test-cases/read-only-stubs/bar.c +++ b/dyld/unit-tests/test-cases/read-only-stubs/bar.c @@ -28,7 +28,8 @@ int barData = 1; -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/read-only-stubs/foo.c b/dyld/unit-tests/test-cases/read-only-stubs/foo.c index 68fb1fb9..629ec3d6 100644 --- a/dyld/unit-tests/test-cases/read-only-stubs/foo.c +++ b/dyld/unit-tests/test-cases/read-only-stubs/foo.c @@ -57,7 +57,8 @@ static vm_prot_t getPermission(void* addr) } -static void* getStubAddr() +static void * +getStubAddr (void) { #if __LP64__ uint64_t size; @@ -95,7 +96,8 @@ static void checkStubs(void* addr) int fooData = 1; -void foo() +void +foo (void) { void* stubAddr = getStubAddr(); checkStubs(stubAddr); diff --git a/dyld/unit-tests/test-cases/read-only-stubs/main.c b/dyld/unit-tests/test-cases/read-only-stubs/main.c index b9420c7b..beaefbcd 100644 --- a/dyld/unit-tests/test-cases/read-only-stubs/main.c +++ b/dyld/unit-tests/test-cases/read-only-stubs/main.c @@ -58,7 +58,8 @@ static vm_prot_t getPermission(void* addr) } -static void* getStubAddr() +static void * +getStubAddr (void) { unsigned long size; #if __i386__ @@ -93,7 +94,8 @@ static void checkStubs(void* addr) } -int main() +int +main (void) { void* stubAddr = getStubAddr(); #if __i386__ @@ -111,7 +113,8 @@ int main() #else -int main() +int +main (void) { // iOS does not have modifiable stubs PASS("read-only-stubs"); diff --git a/dyld/unit-tests/test-cases/restrict-executable_path/foo.c b/dyld/unit-tests/test-cases/restrict-executable_path/foo.c index d2b44c45..9d7c140f 100644 --- a/dyld/unit-tests/test-cases/restrict-executable_path/foo.c +++ b/dyld/unit-tests/test-cases/restrict-executable_path/foo.c @@ -1,5 +1,6 @@ -int foo() { return 1; } +int +foo (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/foo.c b/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/foo.c index a8fe5b09..913dd52a 100644 --- a/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/foo.c +++ b/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/foo.c @@ -20,7 +20,8 @@ * * @APPLE_LICENSE_HEADER_END@ */ -int foo() +int +foo (void) { #if BAD return 0; diff --git a/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/main.c b/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/main.c index 72afbf73..ad8eb7d9 100644 --- a/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/main.c +++ b/dyld/unit-tests/test-cases/rpath-DYLD_FALLBACK_LIBRARY_PATH/main.c @@ -28,7 +28,8 @@ extern int foo(); -int main() +int +main (void) { if ( foo() ) PASS("rpath-DYLD_FALLBACK_LIBRARY_PATH"); diff --git a/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/foo.c b/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/foo.c index a8fe5b09..913dd52a 100644 --- a/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/foo.c +++ b/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/foo.c @@ -20,7 +20,8 @@ * * @APPLE_LICENSE_HEADER_END@ */ -int foo() +int +foo (void) { #if BAD return 0; diff --git a/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/main.c b/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/main.c index 01a144b4..4a80bedf 100644 --- a/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/main.c +++ b/dyld/unit-tests/test-cases/rpath-DYLD_LIBRARY_PATH/main.c @@ -28,7 +28,8 @@ extern int foo(); -int main() +int +main (void) { if ( foo() ) PASS("rpath-DYLD_LIBRARY_PATH"); diff --git a/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/foo.c b/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/foo.c index c5563c57..6dd35fb0 100644 --- a/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/foo.c +++ b/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/foo.c @@ -1,4 +1,5 @@ -int foo() +int +foo (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/main.c b/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/main.c index b379c365..84768e8b 100644 --- a/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/main.c +++ b/dyld/unit-tests/test-cases/rpath-DYLD_ROOT_PATH/main.c @@ -7,7 +7,8 @@ extern int foo(); -int main() +int +main (void) { if ( foo() ) return EXIT_SUCCESS; diff --git a/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/foo.c b/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/foo.c index 79572f95..76c05204 100644 --- a/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/foo.c +++ b/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/foo.c @@ -20,6 +20,7 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/main.c b/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/main.c index 784dee3b..2e8801df 100644 --- a/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/main.c +++ b/dyld/unit-tests/test-cases/rpath-LD_LIBRARY_PATH/main.c @@ -28,7 +28,8 @@ extern void foo(); -int main() +int +main (void) { foo(); PASS("rpath-LD_LIBRARY_PATH"); diff --git a/dyld/unit-tests/test-cases/rpath-basic/bar.c b/dyld/unit-tests/test-cases/rpath-basic/bar.c index b72a1a51..86df6a12 100644 --- a/dyld/unit-tests/test-cases/rpath-basic/bar.c +++ b/dyld/unit-tests/test-cases/rpath-basic/bar.c @@ -1,3 +1,4 @@ -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-basic/foo.c b/dyld/unit-tests/test-cases/rpath-basic/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/rpath-basic/foo.c +++ b/dyld/unit-tests/test-cases/rpath-basic/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-basic/main.c b/dyld/unit-tests/test-cases/rpath-basic/main.c index bf6c7faa..93de37a9 100644 --- a/dyld/unit-tests/test-cases/rpath-basic/main.c +++ b/dyld/unit-tests/test-cases/rpath-basic/main.c @@ -28,7 +28,8 @@ extern void foo(); -int main() +int +main (void) { foo(); PASS("rpath-basic"); diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/bar.c b/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/bar.c index 17ab4f61..c213e972 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/bar.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/bar.c @@ -27,7 +27,8 @@ #include "test.h" -void bar() +void +bar (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/foo.c b/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/foo.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/main.c b/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/main.c index 1eb74298..3bc52c8d 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/main.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-in-dylib/main.c @@ -28,7 +28,8 @@ extern void bar(); -int main() +int +main (void) { bar(); diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-indirect/bar.c b/dyld/unit-tests/test-cases/rpath-dlopen-indirect/bar.c index 160109b0..cc18bcd9 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-indirect/bar.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-indirect/bar.c @@ -5,7 +5,8 @@ #include "test.h" -void bar() +void +bar (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-indirect/foo.c b/dyld/unit-tests/test-cases/rpath-dlopen-indirect/foo.c index 79572f95..76c05204 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-indirect/foo.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-indirect/foo.c @@ -20,6 +20,7 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-indirect/main.c b/dyld/unit-tests/test-cases/rpath-dlopen-indirect/main.c index ba7efb60..1f174cbb 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-indirect/main.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-indirect/main.c @@ -28,7 +28,8 @@ extern void bar(); -int main() +int +main (void) { bar(); diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-leak/foo.c b/dyld/unit-tests/test-cases/rpath-dlopen-leak/foo.c index 79572f95..76c05204 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-leak/foo.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-leak/foo.c @@ -20,6 +20,7 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-leak/main.c b/dyld/unit-tests/test-cases/rpath-dlopen-leak/main.c index 993ea250..da830fbe 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-leak/main.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-leak/main.c @@ -30,7 +30,8 @@ #include "test.h" -int main() +int +main (void) { for (int i=0; i < 100; ++i) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/foo.c b/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/foo.c index 79572f95..76c05204 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/foo.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/foo.c @@ -20,6 +20,7 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/main.c b/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/main.c index 9857c715..b645d084 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/main.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen-rm-executable/main.c @@ -29,7 +29,8 @@ #include "test.h" -int main() +int +main (void) { char buf[2048]; uint32_t bufSize = sizeof(buf); diff --git a/dyld/unit-tests/test-cases/rpath-dlopen/foo.c b/dyld/unit-tests/test-cases/rpath-dlopen/foo.c index 79572f95..76c05204 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen/foo.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen/foo.c @@ -20,6 +20,7 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-dlopen/main.c b/dyld/unit-tests/test-cases/rpath-dlopen/main.c index d4139062..aee7ff3b 100644 --- a/dyld/unit-tests/test-cases/rpath-dlopen/main.c +++ b/dyld/unit-tests/test-cases/rpath-dlopen/main.c @@ -27,7 +27,8 @@ #include "test.h" -int main() +int +main (void) { void* handle = dlopen("libfoo.dylib", RTLD_LAZY); if ( handle == NULL ) { diff --git a/dyld/unit-tests/test-cases/rpath-executable_path/bar.c b/dyld/unit-tests/test-cases/rpath-executable_path/bar.c index 31a758c5..3d8a0221 100644 --- a/dyld/unit-tests/test-cases/rpath-executable_path/bar.c +++ b/dyld/unit-tests/test-cases/rpath-executable_path/bar.c @@ -1,6 +1,7 @@ extern void foo(); -void bar() +void +bar (void) { foo(); } diff --git a/dyld/unit-tests/test-cases/rpath-executable_path/foo.c b/dyld/unit-tests/test-cases/rpath-executable_path/foo.c index 16247579..ae1d5939 100644 --- a/dyld/unit-tests/test-cases/rpath-executable_path/foo.c +++ b/dyld/unit-tests/test-cases/rpath-executable_path/foo.c @@ -1,5 +1,6 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-executable_path/main.c b/dyld/unit-tests/test-cases/rpath-executable_path/main.c index 4612793b..f433ff05 100644 --- a/dyld/unit-tests/test-cases/rpath-executable_path/main.c +++ b/dyld/unit-tests/test-cases/rpath-executable_path/main.c @@ -28,7 +28,8 @@ extern void bar(); -int main() +int +main (void) { bar(); PASS("rpath-executable_path"); diff --git a/dyld/unit-tests/test-cases/rpath-indirect-suid/bar.c b/dyld/unit-tests/test-cases/rpath-indirect-suid/bar.c index b1b8fd77..9d4e0ae8 100644 --- a/dyld/unit-tests/test-cases/rpath-indirect-suid/bar.c +++ b/dyld/unit-tests/test-cases/rpath-indirect-suid/bar.c @@ -1,5 +1,6 @@ -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-indirect-suid/foo.c b/dyld/unit-tests/test-cases/rpath-indirect-suid/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/rpath-indirect-suid/foo.c +++ b/dyld/unit-tests/test-cases/rpath-indirect-suid/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-indirect-suid/main.c b/dyld/unit-tests/test-cases/rpath-indirect-suid/main.c index bdea9f9b..6c0b36a2 100644 --- a/dyld/unit-tests/test-cases/rpath-indirect-suid/main.c +++ b/dyld/unit-tests/test-cases/rpath-indirect-suid/main.c @@ -6,7 +6,8 @@ extern void foo(); -int main() +int +main (void) { foo(); #if DEFAULT_FAIL diff --git a/dyld/unit-tests/test-cases/rpath-install-name/bar.c b/dyld/unit-tests/test-cases/rpath-install-name/bar.c index a27d788c..8b2a614b 100644 --- a/dyld/unit-tests/test-cases/rpath-install-name/bar.c +++ b/dyld/unit-tests/test-cases/rpath-install-name/bar.c @@ -23,7 +23,8 @@ extern void stuff(); -void bar() +void +bar (void) { stuff(); } diff --git a/dyld/unit-tests/test-cases/rpath-install-name/main.c b/dyld/unit-tests/test-cases/rpath-install-name/main.c index 87e0ae4d..c3fd322a 100644 --- a/dyld/unit-tests/test-cases/rpath-install-name/main.c +++ b/dyld/unit-tests/test-cases/rpath-install-name/main.c @@ -27,7 +27,8 @@ #include "test.h" -int main() +int +main (void) { void* h1 = dlopen("./libstuff_better.dylib", RTLD_LAZY); if ( h1 == NULL ) { diff --git a/dyld/unit-tests/test-cases/rpath-install-name/stuff.c b/dyld/unit-tests/test-cases/rpath-install-name/stuff.c index 6b60cb27..94e2417b 100644 --- a/dyld/unit-tests/test-cases/rpath-install-name/stuff.c +++ b/dyld/unit-tests/test-cases/rpath-install-name/stuff.c @@ -27,7 +27,8 @@ #include "test.h" -void stuff() +void +stuff (void) { #if BETTER PASS("rpath-install-name"); diff --git a/dyld/unit-tests/test-cases/rpath-introspection/foo.c b/dyld/unit-tests/test-cases/rpath-introspection/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/rpath-introspection/foo.c +++ b/dyld/unit-tests/test-cases/rpath-introspection/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-introspection/main.c b/dyld/unit-tests/test-cases/rpath-introspection/main.c index 6eba6dac..94400fb3 100644 --- a/dyld/unit-tests/test-cases/rpath-introspection/main.c +++ b/dyld/unit-tests/test-cases/rpath-introspection/main.c @@ -30,7 +30,8 @@ extern void foo(); -int main() +int +main (void) { foo(); diff --git a/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/bar.c b/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/bar.c index f9c07425..51c7e997 100644 --- a/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/bar.c +++ b/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/bar.c @@ -1,6 +1,7 @@ extern void baz(); -void bar() +void +bar (void) { baz(); } diff --git a/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/baz.c b/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/baz.c index 0793d979..fd5b44da 100644 --- a/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/baz.c +++ b/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/baz.c @@ -1,5 +1,6 @@ -void baz() +void +baz (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/main.c b/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/main.c index 69b4a598..1be531e0 100644 --- a/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/main.c +++ b/dyld/unit-tests/test-cases/rpath-loader_path-dlopen/main.c @@ -29,7 +29,8 @@ extern bool foo(); -int main() +int +main (void) { if ( foo() ) PASS("rpath-loader_path-dlopen"); diff --git a/dyld/unit-tests/test-cases/rpath-loader_path/foo.c b/dyld/unit-tests/test-cases/rpath-loader_path/foo.c index 79572f95..76c05204 100644 --- a/dyld/unit-tests/test-cases/rpath-loader_path/foo.c +++ b/dyld/unit-tests/test-cases/rpath-loader_path/foo.c @@ -20,6 +20,7 @@ * * @APPLE_LICENSE_HEADER_END@ */ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-loader_path/main.c b/dyld/unit-tests/test-cases/rpath-loader_path/main.c index bf6c7faa..93de37a9 100644 --- a/dyld/unit-tests/test-cases/rpath-loader_path/main.c +++ b/dyld/unit-tests/test-cases/rpath-loader_path/main.c @@ -28,7 +28,8 @@ extern void foo(); -int main() +int +main (void) { foo(); PASS("rpath-basic"); diff --git a/dyld/unit-tests/test-cases/rpath-nesting/bar.c b/dyld/unit-tests/test-cases/rpath-nesting/bar.c index d47ba495..8a69c11b 100644 --- a/dyld/unit-tests/test-cases/rpath-nesting/bar.c +++ b/dyld/unit-tests/test-cases/rpath-nesting/bar.c @@ -21,7 +21,8 @@ * @APPLE_LICENSE_HEADER_END@ */ -void bar() +void +bar (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-nesting/baz.c b/dyld/unit-tests/test-cases/rpath-nesting/baz.c index dc61b62e..324f41bb 100644 --- a/dyld/unit-tests/test-cases/rpath-nesting/baz.c +++ b/dyld/unit-tests/test-cases/rpath-nesting/baz.c @@ -22,7 +22,8 @@ */ -void baz() +void +baz (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-nesting/foo.c b/dyld/unit-tests/test-cases/rpath-nesting/foo.c index 7b46c28f..85c5ced3 100644 --- a/dyld/unit-tests/test-cases/rpath-nesting/foo.c +++ b/dyld/unit-tests/test-cases/rpath-nesting/foo.c @@ -24,7 +24,8 @@ extern void bar(); extern void baz(); -void foo() +void +foo (void) { bar(); baz(); diff --git a/dyld/unit-tests/test-cases/rpath-nesting/main.c b/dyld/unit-tests/test-cases/rpath-nesting/main.c index 47d3ae23..68a05236 100644 --- a/dyld/unit-tests/test-cases/rpath-nesting/main.c +++ b/dyld/unit-tests/test-cases/rpath-nesting/main.c @@ -28,7 +28,8 @@ extern void foo(); -int main() +int +main (void) { foo(); diff --git a/dyld/unit-tests/test-cases/rpath-no-trailing-slash/foo.c b/dyld/unit-tests/test-cases/rpath-no-trailing-slash/foo.c index 3695dc91..4fa60295 100644 --- a/dyld/unit-tests/test-cases/rpath-no-trailing-slash/foo.c +++ b/dyld/unit-tests/test-cases/rpath-no-trailing-slash/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/dyld/unit-tests/test-cases/rpath-no-trailing-slash/main.c b/dyld/unit-tests/test-cases/rpath-no-trailing-slash/main.c index 97bfaa29..a3b93aed 100644 --- a/dyld/unit-tests/test-cases/rpath-no-trailing-slash/main.c +++ b/dyld/unit-tests/test-cases/rpath-no-trailing-slash/main.c @@ -6,7 +6,8 @@ extern void foo(); -int main() +int +main (void) { foo(); PASS("rpath-no-trailing-slash"); diff --git a/dyld/unit-tests/test-cases/shared-cache-symlink/main.c b/dyld/unit-tests/test-cases/shared-cache-symlink/main.c index fc038c12..d0eaa1c6 100644 --- a/dyld/unit-tests/test-cases/shared-cache-symlink/main.c +++ b/dyld/unit-tests/test-cases/shared-cache-symlink/main.c @@ -34,7 +34,8 @@ // we want to verify that dlopening the symlink name will use the one in the shared cache -int main() +int +main (void) { void* libzHandle = dlopen("/usr/lib/libz.dylib", RTLD_LAZY); if ( libzHandle == NULL ) { diff --git a/dyld/unit-tests/test-cases/shared-region-overlap/main.c b/dyld/unit-tests/test-cases/shared-region-overlap/main.c index 83dfd8a4..ef8c42a9 100644 --- a/dyld/unit-tests/test-cases/shared-region-overlap/main.c +++ b/dyld/unit-tests/test-cases/shared-region-overlap/main.c @@ -3,8 +3,8 @@ #include "test.h" -int -main() +int +main (void) { return EXIT_SUCCESS; } diff --git a/dyld/unit-tests/test-cases/suid-executable_path/foo.c b/dyld/unit-tests/test-cases/suid-executable_path/foo.c index d2b44c45..9d7c140f 100644 --- a/dyld/unit-tests/test-cases/suid-executable_path/foo.c +++ b/dyld/unit-tests/test-cases/suid-executable_path/foo.c @@ -1,5 +1,6 @@ -int foo() { return 1; } +int +foo (void) { return 1; } diff --git a/dyld/unit-tests/test-cases/sym-link-load/base.c b/dyld/unit-tests/test-cases/sym-link-load/base.c index 663274e1..bc6a257e 100644 --- a/dyld/unit-tests/test-cases/sym-link-load/base.c +++ b/dyld/unit-tests/test-cases/sym-link-load/base.c @@ -34,7 +34,8 @@ void setState(int x) } -void baseCheck() +void +baseCheck (void) { switch ( initCount ) { case 0: diff --git a/dyld/unit-tests/test-cases/sym-link-load/main.c b/dyld/unit-tests/test-cases/sym-link-load/main.c index b210384c..34ffa17d 100644 --- a/dyld/unit-tests/test-cases/sym-link-load/main.c +++ b/dyld/unit-tests/test-cases/sym-link-load/main.c @@ -28,7 +28,8 @@ #include "base.h" -int main() +int +main (void) { baseCheck(); return EXIT_SUCCESS; diff --git a/dyld/unit-tests/test-cases/symbol-resolver-basic/foo.c b/dyld/unit-tests/test-cases/symbol-resolver-basic/foo.c index f7b6b4bf..87314e8d 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-basic/foo.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-basic/foo.c @@ -24,19 +24,22 @@ #include -static int foo_ten() +static int +foo_ten (void) { return 10; } -static int foo_zero() +static int +foo_zero (void) { return 0; } // This foo is a "resolver" function that return the actual address of "foo" -void* foo() +void * +foo (void) { __asm__(".symbol_resolver _foo"); // magic until we have compiler support if ( getenv("TEN") != NULL ) diff --git a/dyld/unit-tests/test-cases/symbol-resolver-basic/foo2.c b/dyld/unit-tests/test-cases/symbol-resolver-basic/foo2.c index 3c80d3ff..325282ad 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-basic/foo2.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-basic/foo2.c @@ -26,7 +26,8 @@ extern int foo(); // test that calls to resolver based function in same dylib work -int fooPlusOne() +int +fooPlusOne (void) { return foo() + 1; } diff --git a/dyld/unit-tests/test-cases/symbol-resolver-basic/main.c b/dyld/unit-tests/test-cases/symbol-resolver-basic/main.c index 670984ed..4fb333ee 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-basic/main.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-basic/main.c @@ -30,7 +30,8 @@ extern int foo(); extern int fooPlusOne(); -int main() +int +main (void) { if ( getenv("TEN") != NULL ) { if ( foo() != 10 ) diff --git a/dyld/unit-tests/test-cases/symbol-resolver-interposed/foo.c b/dyld/unit-tests/test-cases/symbol-resolver-interposed/foo.c index 8e9ff7ea..03265536 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-interposed/foo.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-interposed/foo.c @@ -30,19 +30,22 @@ void set_foo(int x) which_foo = x; } -static int foo_ten() +static int +foo_ten (void) { return 10; } -static int foo_zero() +static int +foo_zero (void) { return 0; } // This foo is a "resolver" function that return the actual address of "foo" -void* foo() +void * +foo (void) { __asm__(".symbol_resolver _foo"); // magic until we have compiler support if ( which_foo == 0 ) diff --git a/dyld/unit-tests/test-cases/symbol-resolver-interposed/myfoo.c b/dyld/unit-tests/test-cases/symbol-resolver-interposed/myfoo.c index 62123312..8f024bc4 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-interposed/myfoo.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-interposed/myfoo.c @@ -2,7 +2,8 @@ #include #include "foo.h" -int myfoo() +int +myfoo (void) { foo(); return 20; diff --git a/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/foo.c b/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/foo.c index bb9054ca..6c383d4a 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/foo.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/foo.c @@ -26,7 +26,8 @@ extern int bar(); -int foo() +int +foo (void) { return bar(); } diff --git a/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/main.c b/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/main.c index 212d02f4..630a39a3 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/main.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-lazy-prebound/main.c @@ -28,7 +28,8 @@ typedef int (*Func_t)(void); -int main() +int +main (void) { // RTLD_NOW force lazy pointers to be bound early void* handle = dlopen("libfoo.dylib", RTLD_NOW); diff --git a/dyld/unit-tests/test-cases/symbol-resolver-pointer/foo.c b/dyld/unit-tests/test-cases/symbol-resolver-pointer/foo.c index 71d67bca..e3d12263 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-pointer/foo.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-pointer/foo.c @@ -30,13 +30,15 @@ int realTestCallCount = 0; void test$FOO(); -void test$FOO() { +void +test$FOO (void) { //printf("test\n"); ++realTestCallCount; } void* test_chooser() __asm__("_test"); -void* test_chooser() { +void * +test_chooser (void) { __asm__(".symbol_resolver _test"); //printf("resolver\n"); ++resolverCallCount; @@ -46,7 +48,8 @@ void* test_chooser() { void test(); static void (*t)(void) = test; -void check() { +void +check (void) { t(); // call through initialized pointer t = test; // re-assign pointer via non-lazy-poitner t(); // call agin through pointer diff --git a/dyld/unit-tests/test-cases/symbol-resolver-pointer/main.c b/dyld/unit-tests/test-cases/symbol-resolver-pointer/main.c index 9e7a73bf..bdea5eac 100644 --- a/dyld/unit-tests/test-cases/symbol-resolver-pointer/main.c +++ b/dyld/unit-tests/test-cases/symbol-resolver-pointer/main.c @@ -28,7 +28,8 @@ extern void check(); -int main() +int +main (void) { check(); return EXIT_SUCCESS; diff --git a/dyld/unit-tests/test-cases/text-relocs-perms/foo.c b/dyld/unit-tests/test-cases/text-relocs-perms/foo.c index b644c3db..6116d08f 100644 --- a/dyld/unit-tests/test-cases/text-relocs-perms/foo.c +++ b/dyld/unit-tests/test-cases/text-relocs-perms/foo.c @@ -56,7 +56,8 @@ static vm_prot_t getPermission(void* addr) } -static void* getStubAddr() +static void * +getStubAddr (void) { #if __LP64__ uint64_t size; @@ -94,7 +95,8 @@ static void checkStubs(void* addr) } -void foo() +void +foo (void) { void* stubAddr = getStubAddr(); checkStubs(stubAddr); @@ -102,7 +104,8 @@ void foo() #else -void foo() +void +foo (void) { // iOS does not have text relocs } diff --git a/dyld/unit-tests/test-cases/text-relocs-perms/main.c b/dyld/unit-tests/test-cases/text-relocs-perms/main.c index fc07f175..ddad49a7 100644 --- a/dyld/unit-tests/test-cases/text-relocs-perms/main.c +++ b/dyld/unit-tests/test-cases/text-relocs-perms/main.c @@ -58,7 +58,8 @@ static vm_prot_t getPermission(void* addr) } -static void* getStubAddr() +static void * +getStubAddr (void) { unsigned long size; #if __i386__ @@ -93,7 +94,8 @@ static void checkStubs(void* addr) } -int main() +int +main (void) { foo(); @@ -111,7 +113,8 @@ int main() #else -int main() +int +main (void) { // iOS does not have text relocs PASS("text-relocs-perm"); diff --git a/dyld/unit-tests/test-cases/text-relocs/bar.c b/dyld/unit-tests/test-cases/text-relocs/bar.c index a87566e9..3f5d994a 100644 --- a/dyld/unit-tests/test-cases/text-relocs/bar.c +++ b/dyld/unit-tests/test-cases/text-relocs/bar.c @@ -28,10 +28,12 @@ int y = 0; static int x = 0; -int getx() { return x; } +int +getx (void) { return x; } void setx(int a) { x = a; } -void bar() +void +bar (void) { printf("hello\n"); } diff --git a/dyld/unit-tests/test-cases/text-relocs/bind.c b/dyld/unit-tests/test-cases/text-relocs/bind.c index fa0dd810..969bbaca 100644 --- a/dyld/unit-tests/test-cases/text-relocs/bind.c +++ b/dyld/unit-tests/test-cases/text-relocs/bind.c @@ -1,7 +1,8 @@ extern int y; -int test() +int +test (void) { return y; } diff --git a/dyld/unit-tests/test-cases/threaded-flat-lookup/client.c b/dyld/unit-tests/test-cases/threaded-flat-lookup/client.c index 72ba2189..d834da21 100644 --- a/dyld/unit-tests/test-cases/threaded-flat-lookup/client.c +++ b/dyld/unit-tests/test-cases/threaded-flat-lookup/client.c @@ -3,7 +3,8 @@ extern void foo(); extern void bar(); extern void baz(); -void doit() +void +doit (void) { foo(); bar(); diff --git a/dyld/unit-tests/test-cases/threaded-flat-lookup/foo.c b/dyld/unit-tests/test-cases/threaded-flat-lookup/foo.c index 3f2cbaf4..ba4a0da4 100644 --- a/dyld/unit-tests/test-cases/threaded-flat-lookup/foo.c +++ b/dyld/unit-tests/test-cases/threaded-flat-lookup/foo.c @@ -1,4 +1,7 @@ -void foo() {} -void bar() {} -void baz() {} +void +foo (void) {} +void +bar (void) {} +void +baz (void) {} diff --git a/dyld/unit-tests/test-cases/threaded-flat-lookup/main.c b/dyld/unit-tests/test-cases/threaded-flat-lookup/main.c index 09ee55f0..81986d8c 100644 --- a/dyld/unit-tests/test-cases/threaded-flat-lookup/main.c +++ b/dyld/unit-tests/test-cases/threaded-flat-lookup/main.c @@ -54,7 +54,8 @@ static void* work(void* ignore) } -int main() +int +main (void) { h2 = dlopen("libfoo2.dylib", 0); if ( h2 == NULL ) { diff --git a/dyld/unit-tests/test-cases/threaded-lazy-bind/foo.c b/dyld/unit-tests/test-cases/threaded-lazy-bind/foo.c index d647bd5e..f36a5e0a 100644 --- a/dyld/unit-tests/test-cases/threaded-lazy-bind/foo.c +++ b/dyld/unit-tests/test-cases/threaded-lazy-bind/foo.c @@ -1,1001 +1,2001 @@ -int do_000() { return 0; } -int do_001() { return 1; } -int do_002() { return 2; } -int do_003() { return 3; } -int do_004() { return 4; } -int do_005() { return 5; } -int do_006() { return 6; } -int do_007() { return 7; } -int do_008() { return 8; } -int do_009() { return 9; } -int do_010() { return 10; } -int do_011() { return 11; } -int do_012() { return 12; } -int do_013() { return 13; } -int do_014() { return 14; } -int do_015() { return 15; } -int do_016() { return 16; } -int do_017() { return 17; } -int do_018() { return 18; } -int do_019() { return 19; } -int do_020() { return 20; } -int do_021() { return 21; } -int do_022() { return 22; } -int do_023() { return 23; } -int do_024() { return 24; } -int do_025() { return 25; } -int do_026() { return 26; } -int do_027() { return 27; } -int do_028() { return 28; } -int do_029() { return 29; } -int do_030() { return 30; } -int do_031() { return 31; } -int do_032() { return 32; } -int do_033() { return 33; } -int do_034() { return 34; } -int do_035() { return 35; } -int do_036() { return 36; } -int do_037() { return 37; } -int do_038() { return 38; } -int do_039() { return 39; } -int do_040() { return 40; } -int do_041() { return 41; } -int do_042() { return 42; } -int do_043() { return 43; } -int do_044() { return 44; } -int do_045() { return 45; } -int do_046() { return 46; } -int do_047() { return 47; } -int do_048() { return 48; } -int do_049() { return 49; } -int do_050() { return 50; } -int do_051() { return 51; } -int do_052() { return 52; } -int do_053() { return 53; } -int do_054() { return 54; } -int do_055() { return 55; } -int do_056() { return 56; } -int do_057() { return 57; } -int do_058() { return 58; } -int do_059() { return 59; } -int do_060() { return 60; } -int do_061() { return 61; } -int do_062() { return 62; } -int do_063() { return 63; } -int do_064() { return 64; } -int do_065() { return 65; } -int do_066() { return 66; } -int do_067() { return 67; } -int do_068() { return 68; } -int do_069() { return 69; } -int do_070() { return 70; } -int do_071() { return 71; } -int do_072() { return 72; } -int do_073() { return 73; } -int do_074() { return 74; } -int do_075() { return 75; } -int do_076() { return 76; } -int do_077() { return 77; } -int do_078() { return 78; } -int do_079() { return 79; } -int do_080() { return 80; } -int do_081() { return 81; } -int do_082() { return 82; } -int do_083() { return 83; } -int do_084() { return 84; } -int do_085() { return 85; } -int do_086() { return 86; } -int do_087() { return 87; } -int do_088() { return 88; } -int do_089() { return 89; } -int do_090() { return 90; } -int do_091() { return 91; } -int do_092() { return 92; } -int do_093() { return 93; } -int do_094() { return 94; } -int do_095() { return 95; } -int do_096() { return 96; } -int do_097() { return 97; } -int do_098() { return 98; } -int do_099() { return 99; } -int do_100() { return 100; } -int do_101() { return 101; } -int do_102() { return 102; } -int do_103() { return 103; } -int do_104() { return 104; } -int do_105() { return 105; } -int do_106() { return 106; } -int do_107() { return 107; } -int do_108() { return 108; } -int do_109() { return 109; } -int do_110() { return 110; } -int do_111() { return 111; } -int do_112() { return 112; } -int do_113() { return 113; } -int do_114() { return 114; } -int do_115() { return 115; } -int do_116() { return 116; } -int do_117() { return 117; } -int do_118() { return 118; } -int do_119() { return 119; } -int do_120() { return 120; } -int do_121() { return 121; } -int do_122() { return 122; } -int do_123() { return 123; } -int do_124() { return 124; } -int do_125() { return 125; } -int do_126() { return 126; } -int do_127() { return 127; } -int do_128() { return 128; } -int do_129() { return 129; } -int do_130() { return 130; } -int do_131() { return 131; } -int do_132() { return 132; } -int do_133() { return 133; } -int do_134() { return 134; } -int do_135() { return 135; } -int do_136() { return 136; } -int do_137() { return 137; } -int do_138() { return 138; } -int do_139() { return 139; } -int do_140() { return 140; } -int do_141() { return 141; } -int do_142() { return 142; } -int do_143() { return 143; } -int do_144() { return 144; } -int do_145() { return 145; } -int do_146() { return 146; } -int do_147() { return 147; } -int do_148() { return 148; } -int do_149() { return 149; } -int do_150() { return 150; } -int do_151() { return 151; } -int do_152() { return 152; } -int do_153() { return 153; } -int do_154() { return 154; } -int do_155() { return 155; } -int do_156() { return 156; } -int do_157() { return 157; } -int do_158() { return 158; } -int do_159() { return 159; } -int do_160() { return 160; } -int do_161() { return 161; } -int do_162() { return 162; } -int do_163() { return 163; } -int do_164() { return 164; } -int do_165() { return 165; } -int do_166() { return 166; } -int do_167() { return 167; } -int do_168() { return 168; } -int do_169() { return 169; } -int do_170() { return 170; } -int do_171() { return 171; } -int do_172() { return 172; } -int do_173() { return 173; } -int do_174() { return 174; } -int do_175() { return 175; } -int do_176() { return 176; } -int do_177() { return 177; } -int do_178() { return 178; } -int do_179() { return 179; } -int do_180() { return 180; } -int do_181() { return 181; } -int do_182() { return 182; } -int do_183() { return 183; } -int do_184() { return 184; } -int do_185() { return 185; } -int do_186() { return 186; } -int do_187() { return 187; } -int do_188() { return 188; } -int do_189() { return 189; } -int do_190() { return 190; } -int do_191() { return 191; } -int do_192() { return 192; } -int do_193() { return 193; } -int do_194() { return 194; } -int do_195() { return 195; } -int do_196() { return 196; } -int do_197() { return 197; } -int do_198() { return 198; } -int do_199() { return 199; } -int do_200() { return 200; } -int do_201() { return 201; } -int do_202() { return 202; } -int do_203() { return 203; } -int do_204() { return 204; } -int do_205() { return 205; } -int do_206() { return 206; } -int do_207() { return 207; } -int do_208() { return 208; } -int do_209() { return 209; } -int do_210() { return 210; } -int do_211() { return 211; } -int do_212() { return 212; } -int do_213() { return 213; } -int do_214() { return 214; } -int do_215() { return 215; } -int do_216() { return 216; } -int do_217() { return 217; } -int do_218() { return 218; } -int do_219() { return 219; } -int do_220() { return 220; } -int do_221() { return 221; } -int do_222() { return 222; } -int do_223() { return 223; } -int do_224() { return 224; } -int do_225() { return 225; } -int do_226() { return 226; } -int do_227() { return 227; } -int do_228() { return 228; } -int do_229() { return 229; } -int do_230() { return 230; } -int do_231() { return 231; } -int do_232() { return 232; } -int do_233() { return 233; } -int do_234() { return 234; } -int do_235() { return 235; } -int do_236() { return 236; } -int do_237() { return 237; } -int do_238() { return 238; } -int do_239() { return 239; } -int do_240() { return 240; } -int do_241() { return 241; } -int do_242() { return 242; } -int do_243() { return 243; } -int do_244() { return 244; } -int do_245() { return 245; } -int do_246() { return 246; } -int do_247() { return 247; } -int do_248() { return 248; } -int do_249() { return 249; } -int do_250() { return 250; } -int do_251() { return 251; } -int do_252() { return 252; } -int do_253() { return 253; } -int do_254() { return 254; } -int do_255() { return 255; } -int do_256() { return 256; } -int do_257() { return 257; } -int do_258() { return 258; } -int do_259() { return 259; } -int do_260() { return 260; } -int do_261() { return 261; } -int do_262() { return 262; } -int do_263() { return 263; } -int do_264() { return 264; } -int do_265() { return 265; } -int do_266() { return 266; } -int do_267() { return 267; } -int do_268() { return 268; } -int do_269() { return 269; } -int do_270() { return 270; } -int do_271() { return 271; } -int do_272() { return 272; } -int do_273() { return 273; } -int do_274() { return 274; } -int do_275() { return 275; } -int do_276() { return 276; } -int do_277() { return 277; } -int do_278() { return 278; } -int do_279() { return 279; } -int do_280() { return 280; } -int do_281() { return 281; } -int do_282() { return 282; } -int do_283() { return 283; } -int do_284() { return 284; } -int do_285() { return 285; } -int do_286() { return 286; } -int do_287() { return 287; } -int do_288() { return 288; } -int do_289() { return 289; } -int do_290() { return 290; } -int do_291() { return 291; } -int do_292() { return 292; } -int do_293() { return 293; } -int do_294() { return 294; } -int do_295() { return 295; } -int do_296() { return 296; } -int do_297() { return 297; } -int do_298() { return 298; } -int do_299() { return 299; } -int do_300() { return 300; } -int do_301() { return 301; } -int do_302() { return 302; } -int do_303() { return 303; } -int do_304() { return 304; } -int do_305() { return 305; } -int do_306() { return 306; } -int do_307() { return 307; } -int do_308() { return 308; } -int do_309() { return 309; } -int do_310() { return 310; } -int do_311() { return 311; } -int do_312() { return 312; } -int do_313() { return 313; } -int do_314() { return 314; } -int do_315() { return 315; } -int do_316() { return 316; } -int do_317() { return 317; } -int do_318() { return 318; } -int do_319() { return 319; } -int do_320() { return 320; } -int do_321() { return 321; } -int do_322() { return 322; } -int do_323() { return 323; } -int do_324() { return 324; } -int do_325() { return 325; } -int do_326() { return 326; } -int do_327() { return 327; } -int do_328() { return 328; } -int do_329() { return 329; } -int do_330() { return 330; } -int do_331() { return 331; } -int do_332() { return 332; } -int do_333() { return 333; } -int do_334() { return 334; } -int do_335() { return 335; } -int do_336() { return 336; } -int do_337() { return 337; } -int do_338() { return 338; } -int do_339() { return 339; } -int do_340() { return 340; } -int do_341() { return 341; } -int do_342() { return 342; } -int do_343() { return 343; } -int do_344() { return 344; } -int do_345() { return 345; } -int do_346() { return 346; } -int do_347() { return 347; } -int do_348() { return 348; } -int do_349() { return 349; } -int do_350() { return 350; } -int do_351() { return 351; } -int do_352() { return 352; } -int do_353() { return 353; } -int do_354() { return 354; } -int do_355() { return 355; } -int do_356() { return 356; } -int do_357() { return 357; } -int do_358() { return 358; } -int do_359() { return 359; } -int do_360() { return 360; } -int do_361() { return 361; } -int do_362() { return 362; } -int do_363() { return 363; } -int do_364() { return 364; } -int do_365() { return 365; } -int do_366() { return 366; } -int do_367() { return 367; } -int do_368() { return 368; } -int do_369() { return 369; } -int do_370() { return 370; } -int do_371() { return 371; } -int do_372() { return 372; } -int do_373() { return 373; } -int do_374() { return 374; } -int do_375() { return 375; } -int do_376() { return 376; } -int do_377() { return 377; } -int do_378() { return 378; } -int do_379() { return 379; } -int do_380() { return 380; } -int do_381() { return 381; } -int do_382() { return 382; } -int do_383() { return 383; } -int do_384() { return 384; } -int do_385() { return 385; } -int do_386() { return 386; } -int do_387() { return 387; } -int do_388() { return 388; } -int do_389() { return 389; } -int do_390() { return 390; } -int do_391() { return 391; } -int do_392() { return 392; } -int do_393() { return 393; } -int do_394() { return 394; } -int do_395() { return 395; } -int do_396() { return 396; } -int do_397() { return 397; } -int do_398() { return 398; } -int do_399() { return 399; } -int do_400() { return 400; } -int do_401() { return 401; } -int do_402() { return 402; } -int do_403() { return 403; } -int do_404() { return 404; } -int do_405() { return 405; } -int do_406() { return 406; } -int do_407() { return 407; } -int do_408() { return 408; } -int do_409() { return 409; } -int do_410() { return 410; } -int do_411() { return 411; } -int do_412() { return 412; } -int do_413() { return 413; } -int do_414() { return 414; } -int do_415() { return 415; } -int do_416() { return 416; } -int do_417() { return 417; } -int do_418() { return 418; } -int do_419() { return 419; } -int do_420() { return 420; } -int do_421() { return 421; } -int do_422() { return 422; } -int do_423() { return 423; } -int do_424() { return 424; } -int do_425() { return 425; } -int do_426() { return 426; } -int do_427() { return 427; } -int do_428() { return 428; } -int do_429() { return 429; } -int do_430() { return 430; } -int do_431() { return 431; } -int do_432() { return 432; } -int do_433() { return 433; } -int do_434() { return 434; } -int do_435() { return 435; } -int do_436() { return 436; } -int do_437() { return 437; } -int do_438() { return 438; } -int do_439() { return 439; } -int do_440() { return 440; } -int do_441() { return 441; } -int do_442() { return 442; } -int do_443() { return 443; } -int do_444() { return 444; } -int do_445() { return 445; } -int do_446() { return 446; } -int do_447() { return 447; } -int do_448() { return 448; } -int do_449() { return 449; } -int do_450() { return 450; } -int do_451() { return 451; } -int do_452() { return 452; } -int do_453() { return 453; } -int do_454() { return 454; } -int do_455() { return 455; } -int do_456() { return 456; } -int do_457() { return 457; } -int do_458() { return 458; } -int do_459() { return 459; } -int do_460() { return 460; } -int do_461() { return 461; } -int do_462() { return 462; } -int do_463() { return 463; } -int do_464() { return 464; } -int do_465() { return 465; } -int do_466() { return 466; } -int do_467() { return 467; } -int do_468() { return 468; } -int do_469() { return 469; } -int do_470() { return 470; } -int do_471() { return 471; } -int do_472() { return 472; } -int do_473() { return 473; } -int do_474() { return 474; } -int do_475() { return 475; } -int do_476() { return 476; } -int do_477() { return 477; } -int do_478() { return 478; } -int do_479() { return 479; } -int do_480() { return 480; } -int do_481() { return 481; } -int do_482() { return 482; } -int do_483() { return 483; } -int do_484() { return 484; } -int do_485() { return 485; } -int do_486() { return 486; } -int do_487() { return 487; } -int do_488() { return 488; } -int do_489() { return 489; } -int do_490() { return 490; } -int do_491() { return 491; } -int do_492() { return 492; } -int do_493() { return 493; } -int do_494() { return 494; } -int do_495() { return 495; } -int do_496() { return 496; } -int do_497() { return 497; } -int do_498() { return 498; } -int do_499() { return 499; } -int do_500() { return 500; } -int do_501() { return 501; } -int do_502() { return 502; } -int do_503() { return 503; } -int do_504() { return 504; } -int do_505() { return 505; } -int do_506() { return 506; } -int do_507() { return 507; } -int do_508() { return 508; } -int do_509() { return 509; } -int do_510() { return 510; } -int do_511() { return 511; } -int do_512() { return 512; } -int do_513() { return 513; } -int do_514() { return 514; } -int do_515() { return 515; } -int do_516() { return 516; } -int do_517() { return 517; } -int do_518() { return 518; } -int do_519() { return 519; } -int do_520() { return 520; } -int do_521() { return 521; } -int do_522() { return 522; } -int do_523() { return 523; } -int do_524() { return 524; } -int do_525() { return 525; } -int do_526() { return 526; } -int do_527() { return 527; } -int do_528() { return 528; } -int do_529() { return 529; } -int do_530() { return 530; } -int do_531() { return 531; } -int do_532() { return 532; } -int do_533() { return 533; } -int do_534() { return 534; } -int do_535() { return 535; } -int do_536() { return 536; } -int do_537() { return 537; } -int do_538() { return 538; } -int do_539() { return 539; } -int do_540() { return 540; } -int do_541() { return 541; } -int do_542() { return 542; } -int do_543() { return 543; } -int do_544() { return 544; } -int do_545() { return 545; } -int do_546() { return 546; } -int do_547() { return 547; } -int do_548() { return 548; } -int do_549() { return 549; } -int do_550() { return 550; } -int do_551() { return 551; } -int do_552() { return 552; } -int do_553() { return 553; } -int do_554() { return 554; } -int do_555() { return 555; } -int do_556() { return 556; } -int do_557() { return 557; } -int do_558() { return 558; } -int do_559() { return 559; } -int do_560() { return 560; } -int do_561() { return 561; } -int do_562() { return 562; } -int do_563() { return 563; } -int do_564() { return 564; } -int do_565() { return 565; } -int do_566() { return 566; } -int do_567() { return 567; } -int do_568() { return 568; } -int do_569() { return 569; } -int do_570() { return 570; } -int do_571() { return 571; } -int do_572() { return 572; } -int do_573() { return 573; } -int do_574() { return 574; } -int do_575() { return 575; } -int do_576() { return 576; } -int do_577() { return 577; } -int do_578() { return 578; } -int do_579() { return 579; } -int do_580() { return 580; } -int do_581() { return 581; } -int do_582() { return 582; } -int do_583() { return 583; } -int do_584() { return 584; } -int do_585() { return 585; } -int do_586() { return 586; } -int do_587() { return 587; } -int do_588() { return 588; } -int do_589() { return 589; } -int do_590() { return 590; } -int do_591() { return 591; } -int do_592() { return 592; } -int do_593() { return 593; } -int do_594() { return 594; } -int do_595() { return 595; } -int do_596() { return 596; } -int do_597() { return 597; } -int do_598() { return 598; } -int do_599() { return 599; } -int do_600() { return 600; } -int do_601() { return 601; } -int do_602() { return 602; } -int do_603() { return 603; } -int do_604() { return 604; } -int do_605() { return 605; } -int do_606() { return 606; } -int do_607() { return 607; } -int do_608() { return 608; } -int do_609() { return 609; } -int do_610() { return 610; } -int do_611() { return 611; } -int do_612() { return 612; } -int do_613() { return 613; } -int do_614() { return 614; } -int do_615() { return 615; } -int do_616() { return 616; } -int do_617() { return 617; } -int do_618() { return 618; } -int do_619() { return 619; } -int do_620() { return 620; } -int do_621() { return 621; } -int do_622() { return 622; } -int do_623() { return 623; } -int do_624() { return 624; } -int do_625() { return 625; } -int do_626() { return 626; } -int do_627() { return 627; } -int do_628() { return 628; } -int do_629() { return 629; } -int do_630() { return 630; } -int do_631() { return 631; } -int do_632() { return 632; } -int do_633() { return 633; } -int do_634() { return 634; } -int do_635() { return 635; } -int do_636() { return 636; } -int do_637() { return 637; } -int do_638() { return 638; } -int do_639() { return 639; } -int do_640() { return 640; } -int do_641() { return 641; } -int do_642() { return 642; } -int do_643() { return 643; } -int do_644() { return 644; } -int do_645() { return 645; } -int do_646() { return 646; } -int do_647() { return 647; } -int do_648() { return 648; } -int do_649() { return 649; } -int do_650() { return 650; } -int do_651() { return 651; } -int do_652() { return 652; } -int do_653() { return 653; } -int do_654() { return 654; } -int do_655() { return 655; } -int do_656() { return 656; } -int do_657() { return 657; } -int do_658() { return 658; } -int do_659() { return 659; } -int do_660() { return 660; } -int do_661() { return 661; } -int do_662() { return 662; } -int do_663() { return 663; } -int do_664() { return 664; } -int do_665() { return 665; } -int do_666() { return 666; } -int do_667() { return 667; } -int do_668() { return 668; } -int do_669() { return 669; } -int do_670() { return 670; } -int do_671() { return 671; } -int do_672() { return 672; } -int do_673() { return 673; } -int do_674() { return 674; } -int do_675() { return 675; } -int do_676() { return 676; } -int do_677() { return 677; } -int do_678() { return 678; } -int do_679() { return 679; } -int do_680() { return 680; } -int do_681() { return 681; } -int do_682() { return 682; } -int do_683() { return 683; } -int do_684() { return 684; } -int do_685() { return 685; } -int do_686() { return 686; } -int do_687() { return 687; } -int do_688() { return 688; } -int do_689() { return 689; } -int do_690() { return 690; } -int do_691() { return 691; } -int do_692() { return 692; } -int do_693() { return 693; } -int do_694() { return 694; } -int do_695() { return 695; } -int do_696() { return 696; } -int do_697() { return 697; } -int do_698() { return 698; } -int do_699() { return 699; } -int do_700() { return 700; } -int do_701() { return 701; } -int do_702() { return 702; } -int do_703() { return 703; } -int do_704() { return 704; } -int do_705() { return 705; } -int do_706() { return 706; } -int do_707() { return 707; } -int do_708() { return 708; } -int do_709() { return 709; } -int do_710() { return 710; } -int do_711() { return 711; } -int do_712() { return 712; } -int do_713() { return 713; } -int do_714() { return 714; } -int do_715() { return 715; } -int do_716() { return 716; } -int do_717() { return 717; } -int do_718() { return 718; } -int do_719() { return 719; } -int do_720() { return 720; } -int do_721() { return 721; } -int do_722() { return 722; } -int do_723() { return 723; } -int do_724() { return 724; } -int do_725() { return 725; } -int do_726() { return 726; } -int do_727() { return 727; } -int do_728() { return 728; } -int do_729() { return 729; } -int do_730() { return 730; } -int do_731() { return 731; } -int do_732() { return 732; } -int do_733() { return 733; } -int do_734() { return 734; } -int do_735() { return 735; } -int do_736() { return 736; } -int do_737() { return 737; } -int do_738() { return 738; } -int do_739() { return 739; } -int do_740() { return 740; } -int do_741() { return 741; } -int do_742() { return 742; } -int do_743() { return 743; } -int do_744() { return 744; } -int do_745() { return 745; } -int do_746() { return 746; } -int do_747() { return 747; } -int do_748() { return 748; } -int do_749() { return 749; } -int do_750() { return 750; } -int do_751() { return 751; } -int do_752() { return 752; } -int do_753() { return 753; } -int do_754() { return 754; } -int do_755() { return 755; } -int do_756() { return 756; } -int do_757() { return 757; } -int do_758() { return 758; } -int do_759() { return 759; } -int do_760() { return 760; } -int do_761() { return 761; } -int do_762() { return 762; } -int do_763() { return 763; } -int do_764() { return 764; } -int do_765() { return 765; } -int do_766() { return 766; } -int do_767() { return 767; } -int do_768() { return 768; } -int do_769() { return 769; } -int do_770() { return 770; } -int do_771() { return 771; } -int do_772() { return 772; } -int do_773() { return 773; } -int do_774() { return 774; } -int do_775() { return 775; } -int do_776() { return 776; } -int do_777() { return 777; } -int do_778() { return 778; } -int do_779() { return 779; } -int do_780() { return 780; } -int do_781() { return 781; } -int do_782() { return 782; } -int do_783() { return 783; } -int do_784() { return 784; } -int do_785() { return 785; } -int do_786() { return 786; } -int do_787() { return 787; } -int do_788() { return 788; } -int do_789() { return 789; } -int do_790() { return 790; } -int do_791() { return 791; } -int do_792() { return 792; } -int do_793() { return 793; } -int do_794() { return 794; } -int do_795() { return 795; } -int do_796() { return 796; } -int do_797() { return 797; } -int do_798() { return 798; } -int do_799() { return 799; } -int do_800() { return 800; } -int do_801() { return 801; } -int do_802() { return 802; } -int do_803() { return 803; } -int do_804() { return 804; } -int do_805() { return 805; } -int do_806() { return 806; } -int do_807() { return 807; } -int do_808() { return 808; } -int do_809() { return 809; } -int do_810() { return 810; } -int do_811() { return 811; } -int do_812() { return 812; } -int do_813() { return 813; } -int do_814() { return 814; } -int do_815() { return 815; } -int do_816() { return 816; } -int do_817() { return 817; } -int do_818() { return 818; } -int do_819() { return 819; } -int do_820() { return 820; } -int do_821() { return 821; } -int do_822() { return 822; } -int do_823() { return 823; } -int do_824() { return 824; } -int do_825() { return 825; } -int do_826() { return 826; } -int do_827() { return 827; } -int do_828() { return 828; } -int do_829() { return 829; } -int do_830() { return 830; } -int do_831() { return 831; } -int do_832() { return 832; } -int do_833() { return 833; } -int do_834() { return 834; } -int do_835() { return 835; } -int do_836() { return 836; } -int do_837() { return 837; } -int do_838() { return 838; } -int do_839() { return 839; } -int do_840() { return 840; } -int do_841() { return 841; } -int do_842() { return 842; } -int do_843() { return 843; } -int do_844() { return 844; } -int do_845() { return 845; } -int do_846() { return 846; } -int do_847() { return 847; } -int do_848() { return 848; } -int do_849() { return 849; } -int do_850() { return 850; } -int do_851() { return 851; } -int do_852() { return 852; } -int do_853() { return 853; } -int do_854() { return 854; } -int do_855() { return 855; } -int do_856() { return 856; } -int do_857() { return 857; } -int do_858() { return 858; } -int do_859() { return 859; } -int do_860() { return 860; } -int do_861() { return 861; } -int do_862() { return 862; } -int do_863() { return 863; } -int do_864() { return 864; } -int do_865() { return 865; } -int do_866() { return 866; } -int do_867() { return 867; } -int do_868() { return 868; } -int do_869() { return 869; } -int do_870() { return 870; } -int do_871() { return 871; } -int do_872() { return 872; } -int do_873() { return 873; } -int do_874() { return 874; } -int do_875() { return 875; } -int do_876() { return 876; } -int do_877() { return 877; } -int do_878() { return 878; } -int do_879() { return 879; } -int do_880() { return 880; } -int do_881() { return 881; } -int do_882() { return 882; } -int do_883() { return 883; } -int do_884() { return 884; } -int do_885() { return 885; } -int do_886() { return 886; } -int do_887() { return 887; } -int do_888() { return 888; } -int do_889() { return 889; } -int do_890() { return 890; } -int do_891() { return 891; } -int do_892() { return 892; } -int do_893() { return 893; } -int do_894() { return 894; } -int do_895() { return 895; } -int do_896() { return 896; } -int do_897() { return 897; } -int do_898() { return 898; } -int do_899() { return 899; } -int do_900() { return 900; } -int do_901() { return 901; } -int do_902() { return 902; } -int do_903() { return 903; } -int do_904() { return 904; } -int do_905() { return 905; } -int do_906() { return 906; } -int do_907() { return 907; } -int do_908() { return 908; } -int do_909() { return 909; } -int do_910() { return 910; } -int do_911() { return 911; } -int do_912() { return 912; } -int do_913() { return 913; } -int do_914() { return 914; } -int do_915() { return 915; } -int do_916() { return 916; } -int do_917() { return 917; } -int do_918() { return 918; } -int do_919() { return 919; } -int do_920() { return 920; } -int do_921() { return 921; } -int do_922() { return 922; } -int do_923() { return 923; } -int do_924() { return 924; } -int do_925() { return 925; } -int do_926() { return 926; } -int do_927() { return 927; } -int do_928() { return 928; } -int do_929() { return 929; } -int do_930() { return 930; } -int do_931() { return 931; } -int do_932() { return 932; } -int do_933() { return 933; } -int do_934() { return 934; } -int do_935() { return 935; } -int do_936() { return 936; } -int do_937() { return 937; } -int do_938() { return 938; } -int do_939() { return 939; } -int do_940() { return 940; } -int do_941() { return 941; } -int do_942() { return 942; } -int do_943() { return 943; } -int do_944() { return 944; } -int do_945() { return 945; } -int do_946() { return 946; } -int do_947() { return 947; } -int do_948() { return 948; } -int do_949() { return 949; } -int do_950() { return 950; } -int do_951() { return 951; } -int do_952() { return 952; } -int do_953() { return 953; } -int do_954() { return 954; } -int do_955() { return 955; } -int do_956() { return 956; } -int do_957() { return 957; } -int do_958() { return 958; } -int do_959() { return 959; } -int do_960() { return 960; } -int do_961() { return 961; } -int do_962() { return 962; } -int do_963() { return 963; } -int do_964() { return 964; } -int do_965() { return 965; } -int do_966() { return 966; } -int do_967() { return 967; } -int do_968() { return 968; } -int do_969() { return 969; } -int do_970() { return 970; } -int do_971() { return 971; } -int do_972() { return 972; } -int do_973() { return 973; } -int do_974() { return 974; } -int do_975() { return 975; } -int do_976() { return 976; } -int do_977() { return 977; } -int do_978() { return 978; } -int do_979() { return 979; } -int do_980() { return 980; } -int do_981() { return 981; } -int do_982() { return 982; } -int do_983() { return 983; } -int do_984() { return 984; } -int do_985() { return 985; } -int do_986() { return 986; } -int do_987() { return 987; } -int do_988() { return 988; } -int do_989() { return 989; } -int do_990() { return 990; } -int do_991() { return 991; } -int do_992() { return 992; } -int do_993() { return 993; } -int do_994() { return 994; } -int do_995() { return 995; } -int do_996() { return 996; } -int do_997() { return 997; } -int do_998() { return 998; } -int do_999() { return 999; } +int +do_000 (void) { return 0; } +int +do_001 (void) { return 1; } +int +do_002 (void) { return 2; } +int +do_003 (void) { return 3; } +int +do_004 (void) { return 4; } +int +do_005 (void) { return 5; } +int +do_006 (void) { return 6; } +int +do_007 (void) { return 7; } +int +do_008 (void) { return 8; } +int +do_009 (void) { return 9; } +int +do_010 (void) { return 10; } +int +do_011 (void) { return 11; } +int +do_012 (void) { return 12; } +int +do_013 (void) { return 13; } +int +do_014 (void) { return 14; } +int +do_015 (void) { return 15; } +int +do_016 (void) { return 16; } +int +do_017 (void) { return 17; } +int +do_018 (void) { return 18; } +int +do_019 (void) { return 19; } +int +do_020 (void) { return 20; } +int +do_021 (void) { return 21; } +int +do_022 (void) { return 22; } +int +do_023 (void) { return 23; } +int +do_024 (void) { return 24; } +int +do_025 (void) { return 25; } +int +do_026 (void) { return 26; } +int +do_027 (void) { return 27; } +int +do_028 (void) { return 28; } +int +do_029 (void) { return 29; } +int +do_030 (void) { return 30; } +int +do_031 (void) { return 31; } +int +do_032 (void) { return 32; } +int +do_033 (void) { return 33; } +int +do_034 (void) { return 34; } +int +do_035 (void) { return 35; } +int +do_036 (void) { return 36; } +int +do_037 (void) { return 37; } +int +do_038 (void) { return 38; } +int +do_039 (void) { return 39; } +int +do_040 (void) { return 40; } +int +do_041 (void) { return 41; } +int +do_042 (void) { return 42; } +int +do_043 (void) { return 43; } +int +do_044 (void) { return 44; } +int +do_045 (void) { return 45; } +int +do_046 (void) { return 46; } +int +do_047 (void) { return 47; } +int +do_048 (void) { return 48; } +int +do_049 (void) { return 49; } +int +do_050 (void) { return 50; } +int +do_051 (void) { return 51; } +int +do_052 (void) { return 52; } +int +do_053 (void) { return 53; } +int +do_054 (void) { return 54; } +int +do_055 (void) { return 55; } +int +do_056 (void) { return 56; } +int +do_057 (void) { return 57; } +int +do_058 (void) { return 58; } +int +do_059 (void) { return 59; } +int +do_060 (void) { return 60; } +int +do_061 (void) { return 61; } +int +do_062 (void) { return 62; } +int +do_063 (void) { return 63; } +int +do_064 (void) { return 64; } +int +do_065 (void) { return 65; } +int +do_066 (void) { return 66; } +int +do_067 (void) { return 67; } +int +do_068 (void) { return 68; } +int +do_069 (void) { return 69; } +int +do_070 (void) { return 70; } +int +do_071 (void) { return 71; } +int +do_072 (void) { return 72; } +int +do_073 (void) { return 73; } +int +do_074 (void) { return 74; } +int +do_075 (void) { return 75; } +int +do_076 (void) { return 76; } +int +do_077 (void) { return 77; } +int +do_078 (void) { return 78; } +int +do_079 (void) { return 79; } +int +do_080 (void) { return 80; } +int +do_081 (void) { return 81; } +int +do_082 (void) { return 82; } +int +do_083 (void) { return 83; } +int +do_084 (void) { return 84; } +int +do_085 (void) { return 85; } +int +do_086 (void) { return 86; } +int +do_087 (void) { return 87; } +int +do_088 (void) { return 88; } +int +do_089 (void) { return 89; } +int +do_090 (void) { return 90; } +int +do_091 (void) { return 91; } +int +do_092 (void) { return 92; } +int +do_093 (void) { return 93; } +int +do_094 (void) { return 94; } +int +do_095 (void) { return 95; } +int +do_096 (void) { return 96; } +int +do_097 (void) { return 97; } +int +do_098 (void) { return 98; } +int +do_099 (void) { return 99; } +int +do_100 (void) { return 100; } +int +do_101 (void) { return 101; } +int +do_102 (void) { return 102; } +int +do_103 (void) { return 103; } +int +do_104 (void) { return 104; } +int +do_105 (void) { return 105; } +int +do_106 (void) { return 106; } +int +do_107 (void) { return 107; } +int +do_108 (void) { return 108; } +int +do_109 (void) { return 109; } +int +do_110 (void) { return 110; } +int +do_111 (void) { return 111; } +int +do_112 (void) { return 112; } +int +do_113 (void) { return 113; } +int +do_114 (void) { return 114; } +int +do_115 (void) { return 115; } +int +do_116 (void) { return 116; } +int +do_117 (void) { return 117; } +int +do_118 (void) { return 118; } +int +do_119 (void) { return 119; } +int +do_120 (void) { return 120; } +int +do_121 (void) { return 121; } +int +do_122 (void) { return 122; } +int +do_123 (void) { return 123; } +int +do_124 (void) { return 124; } +int +do_125 (void) { return 125; } +int +do_126 (void) { return 126; } +int +do_127 (void) { return 127; } +int +do_128 (void) { return 128; } +int +do_129 (void) { return 129; } +int +do_130 (void) { return 130; } +int +do_131 (void) { return 131; } +int +do_132 (void) { return 132; } +int +do_133 (void) { return 133; } +int +do_134 (void) { return 134; } +int +do_135 (void) { return 135; } +int +do_136 (void) { return 136; } +int +do_137 (void) { return 137; } +int +do_138 (void) { return 138; } +int +do_139 (void) { return 139; } +int +do_140 (void) { return 140; } +int +do_141 (void) { return 141; } +int +do_142 (void) { return 142; } +int +do_143 (void) { return 143; } +int +do_144 (void) { return 144; } +int +do_145 (void) { return 145; } +int +do_146 (void) { return 146; } +int +do_147 (void) { return 147; } +int +do_148 (void) { return 148; } +int +do_149 (void) { return 149; } +int +do_150 (void) { return 150; } +int +do_151 (void) { return 151; } +int +do_152 (void) { return 152; } +int +do_153 (void) { return 153; } +int +do_154 (void) { return 154; } +int +do_155 (void) { return 155; } +int +do_156 (void) { return 156; } +int +do_157 (void) { return 157; } +int +do_158 (void) { return 158; } +int +do_159 (void) { return 159; } +int +do_160 (void) { return 160; } +int +do_161 (void) { return 161; } +int +do_162 (void) { return 162; } +int +do_163 (void) { return 163; } +int +do_164 (void) { return 164; } +int +do_165 (void) { return 165; } +int +do_166 (void) { return 166; } +int +do_167 (void) { return 167; } +int +do_168 (void) { return 168; } +int +do_169 (void) { return 169; } +int +do_170 (void) { return 170; } +int +do_171 (void) { return 171; } +int +do_172 (void) { return 172; } +int +do_173 (void) { return 173; } +int +do_174 (void) { return 174; } +int +do_175 (void) { return 175; } +int +do_176 (void) { return 176; } +int +do_177 (void) { return 177; } +int +do_178 (void) { return 178; } +int +do_179 (void) { return 179; } +int +do_180 (void) { return 180; } +int +do_181 (void) { return 181; } +int +do_182 (void) { return 182; } +int +do_183 (void) { return 183; } +int +do_184 (void) { return 184; } +int +do_185 (void) { return 185; } +int +do_186 (void) { return 186; } +int +do_187 (void) { return 187; } +int +do_188 (void) { return 188; } +int +do_189 (void) { return 189; } +int +do_190 (void) { return 190; } +int +do_191 (void) { return 191; } +int +do_192 (void) { return 192; } +int +do_193 (void) { return 193; } +int +do_194 (void) { return 194; } +int +do_195 (void) { return 195; } +int +do_196 (void) { return 196; } +int +do_197 (void) { return 197; } +int +do_198 (void) { return 198; } +int +do_199 (void) { return 199; } +int +do_200 (void) { return 200; } +int +do_201 (void) { return 201; } +int +do_202 (void) { return 202; } +int +do_203 (void) { return 203; } +int +do_204 (void) { return 204; } +int +do_205 (void) { return 205; } +int +do_206 (void) { return 206; } +int +do_207 (void) { return 207; } +int +do_208 (void) { return 208; } +int +do_209 (void) { return 209; } +int +do_210 (void) { return 210; } +int +do_211 (void) { return 211; } +int +do_212 (void) { return 212; } +int +do_213 (void) { return 213; } +int +do_214 (void) { return 214; } +int +do_215 (void) { return 215; } +int +do_216 (void) { return 216; } +int +do_217 (void) { return 217; } +int +do_218 (void) { return 218; } +int +do_219 (void) { return 219; } +int +do_220 (void) { return 220; } +int +do_221 (void) { return 221; } +int +do_222 (void) { return 222; } +int +do_223 (void) { return 223; } +int +do_224 (void) { return 224; } +int +do_225 (void) { return 225; } +int +do_226 (void) { return 226; } +int +do_227 (void) { return 227; } +int +do_228 (void) { return 228; } +int +do_229 (void) { return 229; } +int +do_230 (void) { return 230; } +int +do_231 (void) { return 231; } +int +do_232 (void) { return 232; } +int +do_233 (void) { return 233; } +int +do_234 (void) { return 234; } +int +do_235 (void) { return 235; } +int +do_236 (void) { return 236; } +int +do_237 (void) { return 237; } +int +do_238 (void) { return 238; } +int +do_239 (void) { return 239; } +int +do_240 (void) { return 240; } +int +do_241 (void) { return 241; } +int +do_242 (void) { return 242; } +int +do_243 (void) { return 243; } +int +do_244 (void) { return 244; } +int +do_245 (void) { return 245; } +int +do_246 (void) { return 246; } +int +do_247 (void) { return 247; } +int +do_248 (void) { return 248; } +int +do_249 (void) { return 249; } +int +do_250 (void) { return 250; } +int +do_251 (void) { return 251; } +int +do_252 (void) { return 252; } +int +do_253 (void) { return 253; } +int +do_254 (void) { return 254; } +int +do_255 (void) { return 255; } +int +do_256 (void) { return 256; } +int +do_257 (void) { return 257; } +int +do_258 (void) { return 258; } +int +do_259 (void) { return 259; } +int +do_260 (void) { return 260; } +int +do_261 (void) { return 261; } +int +do_262 (void) { return 262; } +int +do_263 (void) { return 263; } +int +do_264 (void) { return 264; } +int +do_265 (void) { return 265; } +int +do_266 (void) { return 266; } +int +do_267 (void) { return 267; } +int +do_268 (void) { return 268; } +int +do_269 (void) { return 269; } +int +do_270 (void) { return 270; } +int +do_271 (void) { return 271; } +int +do_272 (void) { return 272; } +int +do_273 (void) { return 273; } +int +do_274 (void) { return 274; } +int +do_275 (void) { return 275; } +int +do_276 (void) { return 276; } +int +do_277 (void) { return 277; } +int +do_278 (void) { return 278; } +int +do_279 (void) { return 279; } +int +do_280 (void) { return 280; } +int +do_281 (void) { return 281; } +int +do_282 (void) { return 282; } +int +do_283 (void) { return 283; } +int +do_284 (void) { return 284; } +int +do_285 (void) { return 285; } +int +do_286 (void) { return 286; } +int +do_287 (void) { return 287; } +int +do_288 (void) { return 288; } +int +do_289 (void) { return 289; } +int +do_290 (void) { return 290; } +int +do_291 (void) { return 291; } +int +do_292 (void) { return 292; } +int +do_293 (void) { return 293; } +int +do_294 (void) { return 294; } +int +do_295 (void) { return 295; } +int +do_296 (void) { return 296; } +int +do_297 (void) { return 297; } +int +do_298 (void) { return 298; } +int +do_299 (void) { return 299; } +int +do_300 (void) { return 300; } +int +do_301 (void) { return 301; } +int +do_302 (void) { return 302; } +int +do_303 (void) { return 303; } +int +do_304 (void) { return 304; } +int +do_305 (void) { return 305; } +int +do_306 (void) { return 306; } +int +do_307 (void) { return 307; } +int +do_308 (void) { return 308; } +int +do_309 (void) { return 309; } +int +do_310 (void) { return 310; } +int +do_311 (void) { return 311; } +int +do_312 (void) { return 312; } +int +do_313 (void) { return 313; } +int +do_314 (void) { return 314; } +int +do_315 (void) { return 315; } +int +do_316 (void) { return 316; } +int +do_317 (void) { return 317; } +int +do_318 (void) { return 318; } +int +do_319 (void) { return 319; } +int +do_320 (void) { return 320; } +int +do_321 (void) { return 321; } +int +do_322 (void) { return 322; } +int +do_323 (void) { return 323; } +int +do_324 (void) { return 324; } +int +do_325 (void) { return 325; } +int +do_326 (void) { return 326; } +int +do_327 (void) { return 327; } +int +do_328 (void) { return 328; } +int +do_329 (void) { return 329; } +int +do_330 (void) { return 330; } +int +do_331 (void) { return 331; } +int +do_332 (void) { return 332; } +int +do_333 (void) { return 333; } +int +do_334 (void) { return 334; } +int +do_335 (void) { return 335; } +int +do_336 (void) { return 336; } +int +do_337 (void) { return 337; } +int +do_338 (void) { return 338; } +int +do_339 (void) { return 339; } +int +do_340 (void) { return 340; } +int +do_341 (void) { return 341; } +int +do_342 (void) { return 342; } +int +do_343 (void) { return 343; } +int +do_344 (void) { return 344; } +int +do_345 (void) { return 345; } +int +do_346 (void) { return 346; } +int +do_347 (void) { return 347; } +int +do_348 (void) { return 348; } +int +do_349 (void) { return 349; } +int +do_350 (void) { return 350; } +int +do_351 (void) { return 351; } +int +do_352 (void) { return 352; } +int +do_353 (void) { return 353; } +int +do_354 (void) { return 354; } +int +do_355 (void) { return 355; } +int +do_356 (void) { return 356; } +int +do_357 (void) { return 357; } +int +do_358 (void) { return 358; } +int +do_359 (void) { return 359; } +int +do_360 (void) { return 360; } +int +do_361 (void) { return 361; } +int +do_362 (void) { return 362; } +int +do_363 (void) { return 363; } +int +do_364 (void) { return 364; } +int +do_365 (void) { return 365; } +int +do_366 (void) { return 366; } +int +do_367 (void) { return 367; } +int +do_368 (void) { return 368; } +int +do_369 (void) { return 369; } +int +do_370 (void) { return 370; } +int +do_371 (void) { return 371; } +int +do_372 (void) { return 372; } +int +do_373 (void) { return 373; } +int +do_374 (void) { return 374; } +int +do_375 (void) { return 375; } +int +do_376 (void) { return 376; } +int +do_377 (void) { return 377; } +int +do_378 (void) { return 378; } +int +do_379 (void) { return 379; } +int +do_380 (void) { return 380; } +int +do_381 (void) { return 381; } +int +do_382 (void) { return 382; } +int +do_383 (void) { return 383; } +int +do_384 (void) { return 384; } +int +do_385 (void) { return 385; } +int +do_386 (void) { return 386; } +int +do_387 (void) { return 387; } +int +do_388 (void) { return 388; } +int +do_389 (void) { return 389; } +int +do_390 (void) { return 390; } +int +do_391 (void) { return 391; } +int +do_392 (void) { return 392; } +int +do_393 (void) { return 393; } +int +do_394 (void) { return 394; } +int +do_395 (void) { return 395; } +int +do_396 (void) { return 396; } +int +do_397 (void) { return 397; } +int +do_398 (void) { return 398; } +int +do_399 (void) { return 399; } +int +do_400 (void) { return 400; } +int +do_401 (void) { return 401; } +int +do_402 (void) { return 402; } +int +do_403 (void) { return 403; } +int +do_404 (void) { return 404; } +int +do_405 (void) { return 405; } +int +do_406 (void) { return 406; } +int +do_407 (void) { return 407; } +int +do_408 (void) { return 408; } +int +do_409 (void) { return 409; } +int +do_410 (void) { return 410; } +int +do_411 (void) { return 411; } +int +do_412 (void) { return 412; } +int +do_413 (void) { return 413; } +int +do_414 (void) { return 414; } +int +do_415 (void) { return 415; } +int +do_416 (void) { return 416; } +int +do_417 (void) { return 417; } +int +do_418 (void) { return 418; } +int +do_419 (void) { return 419; } +int +do_420 (void) { return 420; } +int +do_421 (void) { return 421; } +int +do_422 (void) { return 422; } +int +do_423 (void) { return 423; } +int +do_424 (void) { return 424; } +int +do_425 (void) { return 425; } +int +do_426 (void) { return 426; } +int +do_427 (void) { return 427; } +int +do_428 (void) { return 428; } +int +do_429 (void) { return 429; } +int +do_430 (void) { return 430; } +int +do_431 (void) { return 431; } +int +do_432 (void) { return 432; } +int +do_433 (void) { return 433; } +int +do_434 (void) { return 434; } +int +do_435 (void) { return 435; } +int +do_436 (void) { return 436; } +int +do_437 (void) { return 437; } +int +do_438 (void) { return 438; } +int +do_439 (void) { return 439; } +int +do_440 (void) { return 440; } +int +do_441 (void) { return 441; } +int +do_442 (void) { return 442; } +int +do_443 (void) { return 443; } +int +do_444 (void) { return 444; } +int +do_445 (void) { return 445; } +int +do_446 (void) { return 446; } +int +do_447 (void) { return 447; } +int +do_448 (void) { return 448; } +int +do_449 (void) { return 449; } +int +do_450 (void) { return 450; } +int +do_451 (void) { return 451; } +int +do_452 (void) { return 452; } +int +do_453 (void) { return 453; } +int +do_454 (void) { return 454; } +int +do_455 (void) { return 455; } +int +do_456 (void) { return 456; } +int +do_457 (void) { return 457; } +int +do_458 (void) { return 458; } +int +do_459 (void) { return 459; } +int +do_460 (void) { return 460; } +int +do_461 (void) { return 461; } +int +do_462 (void) { return 462; } +int +do_463 (void) { return 463; } +int +do_464 (void) { return 464; } +int +do_465 (void) { return 465; } +int +do_466 (void) { return 466; } +int +do_467 (void) { return 467; } +int +do_468 (void) { return 468; } +int +do_469 (void) { return 469; } +int +do_470 (void) { return 470; } +int +do_471 (void) { return 471; } +int +do_472 (void) { return 472; } +int +do_473 (void) { return 473; } +int +do_474 (void) { return 474; } +int +do_475 (void) { return 475; } +int +do_476 (void) { return 476; } +int +do_477 (void) { return 477; } +int +do_478 (void) { return 478; } +int +do_479 (void) { return 479; } +int +do_480 (void) { return 480; } +int +do_481 (void) { return 481; } +int +do_482 (void) { return 482; } +int +do_483 (void) { return 483; } +int +do_484 (void) { return 484; } +int +do_485 (void) { return 485; } +int +do_486 (void) { return 486; } +int +do_487 (void) { return 487; } +int +do_488 (void) { return 488; } +int +do_489 (void) { return 489; } +int +do_490 (void) { return 490; } +int +do_491 (void) { return 491; } +int +do_492 (void) { return 492; } +int +do_493 (void) { return 493; } +int +do_494 (void) { return 494; } +int +do_495 (void) { return 495; } +int +do_496 (void) { return 496; } +int +do_497 (void) { return 497; } +int +do_498 (void) { return 498; } +int +do_499 (void) { return 499; } +int +do_500 (void) { return 500; } +int +do_501 (void) { return 501; } +int +do_502 (void) { return 502; } +int +do_503 (void) { return 503; } +int +do_504 (void) { return 504; } +int +do_505 (void) { return 505; } +int +do_506 (void) { return 506; } +int +do_507 (void) { return 507; } +int +do_508 (void) { return 508; } +int +do_509 (void) { return 509; } +int +do_510 (void) { return 510; } +int +do_511 (void) { return 511; } +int +do_512 (void) { return 512; } +int +do_513 (void) { return 513; } +int +do_514 (void) { return 514; } +int +do_515 (void) { return 515; } +int +do_516 (void) { return 516; } +int +do_517 (void) { return 517; } +int +do_518 (void) { return 518; } +int +do_519 (void) { return 519; } +int +do_520 (void) { return 520; } +int +do_521 (void) { return 521; } +int +do_522 (void) { return 522; } +int +do_523 (void) { return 523; } +int +do_524 (void) { return 524; } +int +do_525 (void) { return 525; } +int +do_526 (void) { return 526; } +int +do_527 (void) { return 527; } +int +do_528 (void) { return 528; } +int +do_529 (void) { return 529; } +int +do_530 (void) { return 530; } +int +do_531 (void) { return 531; } +int +do_532 (void) { return 532; } +int +do_533 (void) { return 533; } +int +do_534 (void) { return 534; } +int +do_535 (void) { return 535; } +int +do_536 (void) { return 536; } +int +do_537 (void) { return 537; } +int +do_538 (void) { return 538; } +int +do_539 (void) { return 539; } +int +do_540 (void) { return 540; } +int +do_541 (void) { return 541; } +int +do_542 (void) { return 542; } +int +do_543 (void) { return 543; } +int +do_544 (void) { return 544; } +int +do_545 (void) { return 545; } +int +do_546 (void) { return 546; } +int +do_547 (void) { return 547; } +int +do_548 (void) { return 548; } +int +do_549 (void) { return 549; } +int +do_550 (void) { return 550; } +int +do_551 (void) { return 551; } +int +do_552 (void) { return 552; } +int +do_553 (void) { return 553; } +int +do_554 (void) { return 554; } +int +do_555 (void) { return 555; } +int +do_556 (void) { return 556; } +int +do_557 (void) { return 557; } +int +do_558 (void) { return 558; } +int +do_559 (void) { return 559; } +int +do_560 (void) { return 560; } +int +do_561 (void) { return 561; } +int +do_562 (void) { return 562; } +int +do_563 (void) { return 563; } +int +do_564 (void) { return 564; } +int +do_565 (void) { return 565; } +int +do_566 (void) { return 566; } +int +do_567 (void) { return 567; } +int +do_568 (void) { return 568; } +int +do_569 (void) { return 569; } +int +do_570 (void) { return 570; } +int +do_571 (void) { return 571; } +int +do_572 (void) { return 572; } +int +do_573 (void) { return 573; } +int +do_574 (void) { return 574; } +int +do_575 (void) { return 575; } +int +do_576 (void) { return 576; } +int +do_577 (void) { return 577; } +int +do_578 (void) { return 578; } +int +do_579 (void) { return 579; } +int +do_580 (void) { return 580; } +int +do_581 (void) { return 581; } +int +do_582 (void) { return 582; } +int +do_583 (void) { return 583; } +int +do_584 (void) { return 584; } +int +do_585 (void) { return 585; } +int +do_586 (void) { return 586; } +int +do_587 (void) { return 587; } +int +do_588 (void) { return 588; } +int +do_589 (void) { return 589; } +int +do_590 (void) { return 590; } +int +do_591 (void) { return 591; } +int +do_592 (void) { return 592; } +int +do_593 (void) { return 593; } +int +do_594 (void) { return 594; } +int +do_595 (void) { return 595; } +int +do_596 (void) { return 596; } +int +do_597 (void) { return 597; } +int +do_598 (void) { return 598; } +int +do_599 (void) { return 599; } +int +do_600 (void) { return 600; } +int +do_601 (void) { return 601; } +int +do_602 (void) { return 602; } +int +do_603 (void) { return 603; } +int +do_604 (void) { return 604; } +int +do_605 (void) { return 605; } +int +do_606 (void) { return 606; } +int +do_607 (void) { return 607; } +int +do_608 (void) { return 608; } +int +do_609 (void) { return 609; } +int +do_610 (void) { return 610; } +int +do_611 (void) { return 611; } +int +do_612 (void) { return 612; } +int +do_613 (void) { return 613; } +int +do_614 (void) { return 614; } +int +do_615 (void) { return 615; } +int +do_616 (void) { return 616; } +int +do_617 (void) { return 617; } +int +do_618 (void) { return 618; } +int +do_619 (void) { return 619; } +int +do_620 (void) { return 620; } +int +do_621 (void) { return 621; } +int +do_622 (void) { return 622; } +int +do_623 (void) { return 623; } +int +do_624 (void) { return 624; } +int +do_625 (void) { return 625; } +int +do_626 (void) { return 626; } +int +do_627 (void) { return 627; } +int +do_628 (void) { return 628; } +int +do_629 (void) { return 629; } +int +do_630 (void) { return 630; } +int +do_631 (void) { return 631; } +int +do_632 (void) { return 632; } +int +do_633 (void) { return 633; } +int +do_634 (void) { return 634; } +int +do_635 (void) { return 635; } +int +do_636 (void) { return 636; } +int +do_637 (void) { return 637; } +int +do_638 (void) { return 638; } +int +do_639 (void) { return 639; } +int +do_640 (void) { return 640; } +int +do_641 (void) { return 641; } +int +do_642 (void) { return 642; } +int +do_643 (void) { return 643; } +int +do_644 (void) { return 644; } +int +do_645 (void) { return 645; } +int +do_646 (void) { return 646; } +int +do_647 (void) { return 647; } +int +do_648 (void) { return 648; } +int +do_649 (void) { return 649; } +int +do_650 (void) { return 650; } +int +do_651 (void) { return 651; } +int +do_652 (void) { return 652; } +int +do_653 (void) { return 653; } +int +do_654 (void) { return 654; } +int +do_655 (void) { return 655; } +int +do_656 (void) { return 656; } +int +do_657 (void) { return 657; } +int +do_658 (void) { return 658; } +int +do_659 (void) { return 659; } +int +do_660 (void) { return 660; } +int +do_661 (void) { return 661; } +int +do_662 (void) { return 662; } +int +do_663 (void) { return 663; } +int +do_664 (void) { return 664; } +int +do_665 (void) { return 665; } +int +do_666 (void) { return 666; } +int +do_667 (void) { return 667; } +int +do_668 (void) { return 668; } +int +do_669 (void) { return 669; } +int +do_670 (void) { return 670; } +int +do_671 (void) { return 671; } +int +do_672 (void) { return 672; } +int +do_673 (void) { return 673; } +int +do_674 (void) { return 674; } +int +do_675 (void) { return 675; } +int +do_676 (void) { return 676; } +int +do_677 (void) { return 677; } +int +do_678 (void) { return 678; } +int +do_679 (void) { return 679; } +int +do_680 (void) { return 680; } +int +do_681 (void) { return 681; } +int +do_682 (void) { return 682; } +int +do_683 (void) { return 683; } +int +do_684 (void) { return 684; } +int +do_685 (void) { return 685; } +int +do_686 (void) { return 686; } +int +do_687 (void) { return 687; } +int +do_688 (void) { return 688; } +int +do_689 (void) { return 689; } +int +do_690 (void) { return 690; } +int +do_691 (void) { return 691; } +int +do_692 (void) { return 692; } +int +do_693 (void) { return 693; } +int +do_694 (void) { return 694; } +int +do_695 (void) { return 695; } +int +do_696 (void) { return 696; } +int +do_697 (void) { return 697; } +int +do_698 (void) { return 698; } +int +do_699 (void) { return 699; } +int +do_700 (void) { return 700; } +int +do_701 (void) { return 701; } +int +do_702 (void) { return 702; } +int +do_703 (void) { return 703; } +int +do_704 (void) { return 704; } +int +do_705 (void) { return 705; } +int +do_706 (void) { return 706; } +int +do_707 (void) { return 707; } +int +do_708 (void) { return 708; } +int +do_709 (void) { return 709; } +int +do_710 (void) { return 710; } +int +do_711 (void) { return 711; } +int +do_712 (void) { return 712; } +int +do_713 (void) { return 713; } +int +do_714 (void) { return 714; } +int +do_715 (void) { return 715; } +int +do_716 (void) { return 716; } +int +do_717 (void) { return 717; } +int +do_718 (void) { return 718; } +int +do_719 (void) { return 719; } +int +do_720 (void) { return 720; } +int +do_721 (void) { return 721; } +int +do_722 (void) { return 722; } +int +do_723 (void) { return 723; } +int +do_724 (void) { return 724; } +int +do_725 (void) { return 725; } +int +do_726 (void) { return 726; } +int +do_727 (void) { return 727; } +int +do_728 (void) { return 728; } +int +do_729 (void) { return 729; } +int +do_730 (void) { return 730; } +int +do_731 (void) { return 731; } +int +do_732 (void) { return 732; } +int +do_733 (void) { return 733; } +int +do_734 (void) { return 734; } +int +do_735 (void) { return 735; } +int +do_736 (void) { return 736; } +int +do_737 (void) { return 737; } +int +do_738 (void) { return 738; } +int +do_739 (void) { return 739; } +int +do_740 (void) { return 740; } +int +do_741 (void) { return 741; } +int +do_742 (void) { return 742; } +int +do_743 (void) { return 743; } +int +do_744 (void) { return 744; } +int +do_745 (void) { return 745; } +int +do_746 (void) { return 746; } +int +do_747 (void) { return 747; } +int +do_748 (void) { return 748; } +int +do_749 (void) { return 749; } +int +do_750 (void) { return 750; } +int +do_751 (void) { return 751; } +int +do_752 (void) { return 752; } +int +do_753 (void) { return 753; } +int +do_754 (void) { return 754; } +int +do_755 (void) { return 755; } +int +do_756 (void) { return 756; } +int +do_757 (void) { return 757; } +int +do_758 (void) { return 758; } +int +do_759 (void) { return 759; } +int +do_760 (void) { return 760; } +int +do_761 (void) { return 761; } +int +do_762 (void) { return 762; } +int +do_763 (void) { return 763; } +int +do_764 (void) { return 764; } +int +do_765 (void) { return 765; } +int +do_766 (void) { return 766; } +int +do_767 (void) { return 767; } +int +do_768 (void) { return 768; } +int +do_769 (void) { return 769; } +int +do_770 (void) { return 770; } +int +do_771 (void) { return 771; } +int +do_772 (void) { return 772; } +int +do_773 (void) { return 773; } +int +do_774 (void) { return 774; } +int +do_775 (void) { return 775; } +int +do_776 (void) { return 776; } +int +do_777 (void) { return 777; } +int +do_778 (void) { return 778; } +int +do_779 (void) { return 779; } +int +do_780 (void) { return 780; } +int +do_781 (void) { return 781; } +int +do_782 (void) { return 782; } +int +do_783 (void) { return 783; } +int +do_784 (void) { return 784; } +int +do_785 (void) { return 785; } +int +do_786 (void) { return 786; } +int +do_787 (void) { return 787; } +int +do_788 (void) { return 788; } +int +do_789 (void) { return 789; } +int +do_790 (void) { return 790; } +int +do_791 (void) { return 791; } +int +do_792 (void) { return 792; } +int +do_793 (void) { return 793; } +int +do_794 (void) { return 794; } +int +do_795 (void) { return 795; } +int +do_796 (void) { return 796; } +int +do_797 (void) { return 797; } +int +do_798 (void) { return 798; } +int +do_799 (void) { return 799; } +int +do_800 (void) { return 800; } +int +do_801 (void) { return 801; } +int +do_802 (void) { return 802; } +int +do_803 (void) { return 803; } +int +do_804 (void) { return 804; } +int +do_805 (void) { return 805; } +int +do_806 (void) { return 806; } +int +do_807 (void) { return 807; } +int +do_808 (void) { return 808; } +int +do_809 (void) { return 809; } +int +do_810 (void) { return 810; } +int +do_811 (void) { return 811; } +int +do_812 (void) { return 812; } +int +do_813 (void) { return 813; } +int +do_814 (void) { return 814; } +int +do_815 (void) { return 815; } +int +do_816 (void) { return 816; } +int +do_817 (void) { return 817; } +int +do_818 (void) { return 818; } +int +do_819 (void) { return 819; } +int +do_820 (void) { return 820; } +int +do_821 (void) { return 821; } +int +do_822 (void) { return 822; } +int +do_823 (void) { return 823; } +int +do_824 (void) { return 824; } +int +do_825 (void) { return 825; } +int +do_826 (void) { return 826; } +int +do_827 (void) { return 827; } +int +do_828 (void) { return 828; } +int +do_829 (void) { return 829; } +int +do_830 (void) { return 830; } +int +do_831 (void) { return 831; } +int +do_832 (void) { return 832; } +int +do_833 (void) { return 833; } +int +do_834 (void) { return 834; } +int +do_835 (void) { return 835; } +int +do_836 (void) { return 836; } +int +do_837 (void) { return 837; } +int +do_838 (void) { return 838; } +int +do_839 (void) { return 839; } +int +do_840 (void) { return 840; } +int +do_841 (void) { return 841; } +int +do_842 (void) { return 842; } +int +do_843 (void) { return 843; } +int +do_844 (void) { return 844; } +int +do_845 (void) { return 845; } +int +do_846 (void) { return 846; } +int +do_847 (void) { return 847; } +int +do_848 (void) { return 848; } +int +do_849 (void) { return 849; } +int +do_850 (void) { return 850; } +int +do_851 (void) { return 851; } +int +do_852 (void) { return 852; } +int +do_853 (void) { return 853; } +int +do_854 (void) { return 854; } +int +do_855 (void) { return 855; } +int +do_856 (void) { return 856; } +int +do_857 (void) { return 857; } +int +do_858 (void) { return 858; } +int +do_859 (void) { return 859; } +int +do_860 (void) { return 860; } +int +do_861 (void) { return 861; } +int +do_862 (void) { return 862; } +int +do_863 (void) { return 863; } +int +do_864 (void) { return 864; } +int +do_865 (void) { return 865; } +int +do_866 (void) { return 866; } +int +do_867 (void) { return 867; } +int +do_868 (void) { return 868; } +int +do_869 (void) { return 869; } +int +do_870 (void) { return 870; } +int +do_871 (void) { return 871; } +int +do_872 (void) { return 872; } +int +do_873 (void) { return 873; } +int +do_874 (void) { return 874; } +int +do_875 (void) { return 875; } +int +do_876 (void) { return 876; } +int +do_877 (void) { return 877; } +int +do_878 (void) { return 878; } +int +do_879 (void) { return 879; } +int +do_880 (void) { return 880; } +int +do_881 (void) { return 881; } +int +do_882 (void) { return 882; } +int +do_883 (void) { return 883; } +int +do_884 (void) { return 884; } +int +do_885 (void) { return 885; } +int +do_886 (void) { return 886; } +int +do_887 (void) { return 887; } +int +do_888 (void) { return 888; } +int +do_889 (void) { return 889; } +int +do_890 (void) { return 890; } +int +do_891 (void) { return 891; } +int +do_892 (void) { return 892; } +int +do_893 (void) { return 893; } +int +do_894 (void) { return 894; } +int +do_895 (void) { return 895; } +int +do_896 (void) { return 896; } +int +do_897 (void) { return 897; } +int +do_898 (void) { return 898; } +int +do_899 (void) { return 899; } +int +do_900 (void) { return 900; } +int +do_901 (void) { return 901; } +int +do_902 (void) { return 902; } +int +do_903 (void) { return 903; } +int +do_904 (void) { return 904; } +int +do_905 (void) { return 905; } +int +do_906 (void) { return 906; } +int +do_907 (void) { return 907; } +int +do_908 (void) { return 908; } +int +do_909 (void) { return 909; } +int +do_910 (void) { return 910; } +int +do_911 (void) { return 911; } +int +do_912 (void) { return 912; } +int +do_913 (void) { return 913; } +int +do_914 (void) { return 914; } +int +do_915 (void) { return 915; } +int +do_916 (void) { return 916; } +int +do_917 (void) { return 917; } +int +do_918 (void) { return 918; } +int +do_919 (void) { return 919; } +int +do_920 (void) { return 920; } +int +do_921 (void) { return 921; } +int +do_922 (void) { return 922; } +int +do_923 (void) { return 923; } +int +do_924 (void) { return 924; } +int +do_925 (void) { return 925; } +int +do_926 (void) { return 926; } +int +do_927 (void) { return 927; } +int +do_928 (void) { return 928; } +int +do_929 (void) { return 929; } +int +do_930 (void) { return 930; } +int +do_931 (void) { return 931; } +int +do_932 (void) { return 932; } +int +do_933 (void) { return 933; } +int +do_934 (void) { return 934; } +int +do_935 (void) { return 935; } +int +do_936 (void) { return 936; } +int +do_937 (void) { return 937; } +int +do_938 (void) { return 938; } +int +do_939 (void) { return 939; } +int +do_940 (void) { return 940; } +int +do_941 (void) { return 941; } +int +do_942 (void) { return 942; } +int +do_943 (void) { return 943; } +int +do_944 (void) { return 944; } +int +do_945 (void) { return 945; } +int +do_946 (void) { return 946; } +int +do_947 (void) { return 947; } +int +do_948 (void) { return 948; } +int +do_949 (void) { return 949; } +int +do_950 (void) { return 950; } +int +do_951 (void) { return 951; } +int +do_952 (void) { return 952; } +int +do_953 (void) { return 953; } +int +do_954 (void) { return 954; } +int +do_955 (void) { return 955; } +int +do_956 (void) { return 956; } +int +do_957 (void) { return 957; } +int +do_958 (void) { return 958; } +int +do_959 (void) { return 959; } +int +do_960 (void) { return 960; } +int +do_961 (void) { return 961; } +int +do_962 (void) { return 962; } +int +do_963 (void) { return 963; } +int +do_964 (void) { return 964; } +int +do_965 (void) { return 965; } +int +do_966 (void) { return 966; } +int +do_967 (void) { return 967; } +int +do_968 (void) { return 968; } +int +do_969 (void) { return 969; } +int +do_970 (void) { return 970; } +int +do_971 (void) { return 971; } +int +do_972 (void) { return 972; } +int +do_973 (void) { return 973; } +int +do_974 (void) { return 974; } +int +do_975 (void) { return 975; } +int +do_976 (void) { return 976; } +int +do_977 (void) { return 977; } +int +do_978 (void) { return 978; } +int +do_979 (void) { return 979; } +int +do_980 (void) { return 980; } +int +do_981 (void) { return 981; } +int +do_982 (void) { return 982; } +int +do_983 (void) { return 983; } +int +do_984 (void) { return 984; } +int +do_985 (void) { return 985; } +int +do_986 (void) { return 986; } +int +do_987 (void) { return 987; } +int +do_988 (void) { return 988; } +int +do_989 (void) { return 989; } +int +do_990 (void) { return 990; } +int +do_991 (void) { return 991; } +int +do_992 (void) { return 992; } +int +do_993 (void) { return 993; } +int +do_994 (void) { return 994; } +int +do_995 (void) { return 995; } +int +do_996 (void) { return 996; } +int +do_997 (void) { return 997; } +int +do_998 (void) { return 998; } +int +do_999 (void) { return 999; } diff --git a/dyld/unit-tests/test-cases/threaded-lazy-bind/gen.c b/dyld/unit-tests/test-cases/threaded-lazy-bind/gen.c index 03bd744d..8820b0a5 100644 --- a/dyld/unit-tests/test-cases/threaded-lazy-bind/gen.c +++ b/dyld/unit-tests/test-cases/threaded-lazy-bind/gen.c @@ -1,7 +1,8 @@ #include -int main() +int +main (void) { int i; for (i = 0; i < 1000; ++i) { diff --git a/dyld/unit-tests/test-cases/threaded-lazy-bind/main.c b/dyld/unit-tests/test-cases/threaded-lazy-bind/main.c index ebb0e0de..180eaf88 100644 --- a/dyld/unit-tests/test-cases/threaded-lazy-bind/main.c +++ b/dyld/unit-tests/test-cases/threaded-lazy-bind/main.c @@ -2040,7 +2040,8 @@ static void* work(void* ignore) } -int main() +int +main (void) { pthread_t worker[10]; for (int i=0; i < 10; ++i) { diff --git a/dyld/unit-tests/test-cases/tlv-dylib/foo.c b/dyld/unit-tests/test-cases/tlv-dylib/foo.c index 4a47edbb..0cee1293 100644 --- a/dyld/unit-tests/test-cases/tlv-dylib/foo.c +++ b/dyld/unit-tests/test-cases/tlv-dylib/foo.c @@ -5,4 +5,5 @@ __thread int a; __thread int b = 5; -int getB() { return b; } +int +getB (void) { return b; } diff --git a/dyld/unit-tests/test-cases/tlv-dylib/main.c b/dyld/unit-tests/test-cases/tlv-dylib/main.c index 117a6463..21ac1da5 100644 --- a/dyld/unit-tests/test-cases/tlv-dylib/main.c +++ b/dyld/unit-tests/test-cases/tlv-dylib/main.c @@ -55,7 +55,8 @@ static void* work(void* arg) return NULL; } -int main() +int +main (void) { pthread_t worker1; if ( pthread_create(&worker1, NULL, work, NULL) != 0 ) { diff --git a/dyld/unit-tests/test-cases/tlv-initializer/main.c b/dyld/unit-tests/test-cases/tlv-initializer/main.c index 3f89123e..7ef33d5f 100644 --- a/dyld/unit-tests/test-cases/tlv-initializer/main.c +++ b/dyld/unit-tests/test-cases/tlv-initializer/main.c @@ -30,7 +30,8 @@ __thread int a = 0; // initially 0 __thread int b = 5; // initially 5 // simulate C++ initializer on thread local variables -void myinit() +void +myinit (void) { a = 11; b = 42; @@ -50,7 +51,8 @@ static void* work(void* arg) return NULL; } -int main() +int +main (void) { pthread_t worker1; if ( pthread_create(&worker1, NULL, work, NULL) != 0 ) { diff --git a/dyld/unit-tests/test-cases/tlv-terminators/main.c b/dyld/unit-tests/test-cases/tlv-terminators/main.c index 94d1d2a3..03045216 100644 --- a/dyld/unit-tests/test-cases/tlv-terminators/main.c +++ b/dyld/unit-tests/test-cases/tlv-terminators/main.c @@ -47,7 +47,8 @@ __thread int b = 5; // statically, initially 5 extern void _tlv_atexit(void (*termfunc)(void* objAddr), void* objAddr); -void myinit() +void +myinit (void) { a = 11; // dynamically initialized to 11 b = 42; // dynamically initialized to 42 @@ -95,7 +96,8 @@ static void* work(void* arg) return NULL; } -int main() +int +main (void) { pthread_t worker1; if ( pthread_create(&worker1, NULL, work, &thread1) != 0 ) { diff --git a/dyld/unit-tests/test-cases/trie-symbol-overrun/foo.c b/dyld/unit-tests/test-cases/trie-symbol-overrun/foo.c index 62d5f38d..1789f607 100644 --- a/dyld/unit-tests/test-cases/trie-symbol-overrun/foo.c +++ b/dyld/unit-tests/test-cases/trie-symbol-overrun/foo.c @@ -1,12 +1,15 @@ -void abc() +void +abc (void) { } -void abcdefghi() +void +abcdefghi (void) { } -void abcdee() +void +abcdee (void) { } diff --git a/dyld/unit-tests/test-cases/trie-symbol-overrun/main.c b/dyld/unit-tests/test-cases/trie-symbol-overrun/main.c index e3d07f1e..2a450a31 100644 --- a/dyld/unit-tests/test-cases/trie-symbol-overrun/main.c +++ b/dyld/unit-tests/test-cases/trie-symbol-overrun/main.c @@ -33,7 +33,8 @@ -int main() +int +main (void) { // allocate two pages vm_address_t addr = 0; diff --git a/dyld/unit-tests/test-cases/unloadable-library-residue/foo.c b/dyld/unit-tests/test-cases/unloadable-library-residue/foo.c index 8abc708b..1fb8a437 100644 --- a/dyld/unit-tests/test-cases/unloadable-library-residue/foo.c +++ b/dyld/unit-tests/test-cases/unloadable-library-residue/foo.c @@ -27,7 +27,8 @@ extern int bar3; -int foo() +int +foo (void) { return bar1 + bar2 + bar3; } diff --git a/dyld/unit-tests/test-cases/unloadable-library-residue/main.c b/dyld/unit-tests/test-cases/unloadable-library-residue/main.c index d1bab845..7534136b 100644 --- a/dyld/unit-tests/test-cases/unloadable-library-residue/main.c +++ b/dyld/unit-tests/test-cases/unloadable-library-residue/main.c @@ -29,7 +29,8 @@ #include "test.h" // PASS(), FAIL() -int main() +int +main (void) { #if __MAC_OS_X_VERSION_MIN_REQUIRED // load libfoo which depends on libbar diff --git a/dyld/unit-tests/test-cases/upward-dylib-init-order/common.c b/dyld/unit-tests/test-cases/upward-dylib-init-order/common.c index 663e4a19..e86b1c87 100644 --- a/dyld/unit-tests/test-cases/upward-dylib-init-order/common.c +++ b/dyld/unit-tests/test-cases/upward-dylib-init-order/common.c @@ -6,21 +6,24 @@ static bool u = false; static bool u2 = false; static bool isOk = true; -void setB() +void +setB (void) { if ( u || b || u2 ) isOk = false; b = true; } -void setU() +void +setU (void) { if ( u || u2 ) isOk = false; u = true; } -void setU2() +void +setU2 (void) { if ( u2 ) isOk = false; diff --git a/dyld/unit-tests/test-cases/upward-dylib-init-order/main.c b/dyld/unit-tests/test-cases/upward-dylib-init-order/main.c index e7edc551..ced11afe 100644 --- a/dyld/unit-tests/test-cases/upward-dylib-init-order/main.c +++ b/dyld/unit-tests/test-cases/upward-dylib-init-order/main.c @@ -6,7 +6,8 @@ #include "common.h" -int main() +int +main (void) { if ( ok() ) PASS("upward-dylib-init-order"); diff --git a/dyld/unit-tests/test-cases/upward-dylib/main.c b/dyld/unit-tests/test-cases/upward-dylib/main.c index 302478a7..d8900875 100644 --- a/dyld/unit-tests/test-cases/upward-dylib/main.c +++ b/dyld/unit-tests/test-cases/upward-dylib/main.c @@ -7,7 +7,8 @@ #include "up.h" #include "down.h" -int main() +int +main (void) { if ( whatsup() ) PASS("upward-dylib"); diff --git a/dyld/unit-tests/test-cases/upward-dylib/main2.c b/dyld/unit-tests/test-cases/upward-dylib/main2.c index 25ee4eba..3f930da4 100644 --- a/dyld/unit-tests/test-cases/upward-dylib/main2.c +++ b/dyld/unit-tests/test-cases/upward-dylib/main2.c @@ -7,7 +7,8 @@ #include "up.h" #include "down.h" -int main() +int +main (void) { if ( getdownsup() ) PASS("upward-dylib"); diff --git a/dyld/unit-tests/test-cases/weak-coalesce-inserted/base.c b/dyld/unit-tests/test-cases/weak-coalesce-inserted/base.c index a2d200b8..3aa2d29e 100644 --- a/dyld/unit-tests/test-cases/weak-coalesce-inserted/base.c +++ b/dyld/unit-tests/test-cases/weak-coalesce-inserted/base.c @@ -73,7 +73,8 @@ void baseVerifyCoal2(const char* where, int* addr) -void baseCheck() +void +baseCheck (void) { if ( wasProblem || (checkInCountCoal1 != 3) || (checkInCountCoal2 != 2) ) FAIL("weak-coal"); diff --git a/dyld/unit-tests/test-cases/weak-coalesce-stubs/main.c b/dyld/unit-tests/test-cases/weak-coalesce-stubs/main.c index 11a4c89b..76ed2b01 100644 --- a/dyld/unit-tests/test-cases/weak-coalesce-stubs/main.c +++ b/dyld/unit-tests/test-cases/weak-coalesce-stubs/main.c @@ -6,7 +6,8 @@ // Loading MH_DYLIB_STUB causing coalescable miscount -int main() +int +main (void) { // try to load stub many times for (int i=0; i < 10; ++i) { diff --git a/dyld/unit-tests/test-cases/weak-coalesce/base.c b/dyld/unit-tests/test-cases/weak-coalesce/base.c index 0deff525..a20d9075 100644 --- a/dyld/unit-tests/test-cases/weak-coalesce/base.c +++ b/dyld/unit-tests/test-cases/weak-coalesce/base.c @@ -73,7 +73,8 @@ void baseVerifyCoal2(const char* where, int* addr) -void baseCheck() +void +baseCheck (void) { if ( wasProblem || (checkInCountCoal1 != 4) || (checkInCountCoal2 != 4) ) FAIL("weak-coal"); diff --git a/dyld/unit-tests/test-cases/weak-coalesce/main.c b/dyld/unit-tests/test-cases/weak-coalesce/main.c index 6f4f9e14..93af1db6 100644 --- a/dyld/unit-tests/test-cases/weak-coalesce/main.c +++ b/dyld/unit-tests/test-cases/weak-coalesce/main.c @@ -28,7 +28,8 @@ #include "base.h" -int main() +int +main (void) { //fprintf(stderr, "myinit() in foo1.c\n"); diff --git a/dyld/unit-tests/test-cases/weak-external-reloc-flat/main.c b/dyld/unit-tests/test-cases/weak-external-reloc-flat/main.c index e74b44db..0e7dd8cf 100644 --- a/dyld/unit-tests/test-cases/weak-external-reloc-flat/main.c +++ b/dyld/unit-tests/test-cases/weak-external-reloc-flat/main.c @@ -24,7 +24,8 @@ int* pbar = &bar[1]; // the function should use libfoo's frob[] even if libfoo is flat extern int getfrob(); -int main() +int +main (void) { if ( *pfoo != 7 ) FAIL("weak-external-reloc-flat, pfoo=%d", *pfoo); diff --git a/dyld/unit-tests/test-cases/weak-external-reloc/main.c b/dyld/unit-tests/test-cases/weak-external-reloc/main.c index a25c4480..d6767d8e 100644 --- a/dyld/unit-tests/test-cases/weak-external-reloc/main.c +++ b/dyld/unit-tests/test-cases/weak-external-reloc/main.c @@ -1,7 +1,8 @@ extern void realmain(); -int main() +int +main (void) { realmain(); return 0; diff --git a/dyld/unit-tests/test-cases/weak-in-dylib/main.c b/dyld/unit-tests/test-cases/weak-in-dylib/main.c index 358e0f79..b3f74a2f 100644 --- a/dyld/unit-tests/test-cases/weak-in-dylib/main.c +++ b/dyld/unit-tests/test-cases/weak-in-dylib/main.c @@ -9,7 +9,8 @@ extern int foo[]; int* pfoo3 = &foo[3]; -int main() +int +main (void) { if ( *pfoo3 != 4 ) FAIL("weak-in-dylib, pfoo3=%d", *pfoo3); diff --git a/dyld/unit-tests/test-cases/weak-lazy-slidable/main.c b/dyld/unit-tests/test-cases/weak-lazy-slidable/main.c index a91ef852..614f0718 100644 --- a/dyld/unit-tests/test-cases/weak-lazy-slidable/main.c +++ b/dyld/unit-tests/test-cases/weak-lazy-slidable/main.c @@ -11,7 +11,8 @@ extern bool foo1(); extern bool foo2(); -int main() +int +main (void) { if ( foo1() && foo2() ) PASS("weak-lazy-slidable"); diff --git a/dyld/unit-tests/test-cases/weak-library/foo.c b/dyld/unit-tests/test-cases/weak-library/foo.c index 55808e47..6913c7f5 100644 --- a/dyld/unit-tests/test-cases/weak-library/foo.c +++ b/dyld/unit-tests/test-cases/weak-library/foo.c @@ -22,7 +22,8 @@ */ #include "foo.h" -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/weak-non-lazy/main.c b/dyld/unit-tests/test-cases/weak-non-lazy/main.c index 523b7be5..a2868037 100644 --- a/dyld/unit-tests/test-cases/weak-non-lazy/main.c +++ b/dyld/unit-tests/test-cases/weak-non-lazy/main.c @@ -3,7 +3,8 @@ // put test code in a dylib so that is slides extern void realmain(); -int main() +int +main (void) { realmain(); return 0; diff --git a/dyld/unit-tests/test-cases/weak-override/main.c b/dyld/unit-tests/test-cases/weak-override/main.c index 8010cc0e..fe94591c 100644 --- a/dyld/unit-tests/test-cases/weak-override/main.c +++ b/dyld/unit-tests/test-cases/weak-override/main.c @@ -30,7 +30,8 @@ extern int foo(); // bar is defined in libfoo.dylib it calls myfunc() extern int bar(); -int main() +int +main (void) { if ( (foo() == 10) && (bar() == 10) ) PASS("weak-override"); @@ -41,7 +42,8 @@ int main() // myfunc() also defined in libfoo.dylib but weak there, so this should override -int myfunc() +int +myfunc (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/weak-symbol-flat/foo.c b/dyld/unit-tests/test-cases/weak-symbol-flat/foo.c index b4b8cea5..212889e0 100644 --- a/dyld/unit-tests/test-cases/weak-symbol-flat/foo.c +++ b/dyld/unit-tests/test-cases/weak-symbol-flat/foo.c @@ -23,7 +23,8 @@ #ifdef SYMBOL_PRESENT -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/weak-symbol/foo.c b/dyld/unit-tests/test-cases/weak-symbol/foo.c index c7a34098..79024fe6 100644 --- a/dyld/unit-tests/test-cases/weak-symbol/foo.c +++ b/dyld/unit-tests/test-cases/weak-symbol/foo.c @@ -21,7 +21,8 @@ * @APPLE_LICENSE_HEADER_END@ */ #if SYMBOL_PRESENT -int foo() +int +foo (void) { return 10; } diff --git a/dyld/unit-tests/test-cases/weak_import/foo.c b/dyld/unit-tests/test-cases/weak_import/foo.c index 8f508355..e49a5083 100644 --- a/dyld/unit-tests/test-cases/weak_import/foo.c +++ b/dyld/unit-tests/test-cases/weak_import/foo.c @@ -2,15 +2,19 @@ #include "foo.h" -void func1() {} -void func3() {} +void +func1 (void) {} +void +func3 (void) {} int data1 = 0; int data3; int data5 = 0; #if ALL_SYMBOLS -void func2() {} -void func4() {} +void +func2 (void) {} +void +func4 (void) {} int data2 = 0; // weak_import initialized int data4; // weak_import uninitialized diff --git a/dyld/unit-tests/test-cases/zero-length-segment/foo.c b/dyld/unit-tests/test-cases/zero-length-segment/foo.c index 85e6cd8c..4c76cef7 100644 --- a/dyld/unit-tests/test-cases/zero-length-segment/foo.c +++ b/dyld/unit-tests/test-cases/zero-length-segment/foo.c @@ -1 +1,2 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/ld64.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ld64/ld64.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/ld64/ld64.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ld64/src/CMakeLists.txt b/ld64/src/CMakeLists.txt index 1be1a5e7..0f6a0f46 100644 --- a/ld64/src/CMakeLists.txt +++ b/ld64/src/CMakeLists.txt @@ -76,4 +76,4 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/abstraction") add_subdirectory(ld) add_subdirectory(other) -add_library(prunetrie other/PruneTrie.cpp) +add_library(prunetrie STATIC other/PruneTrie.cpp) diff --git a/ld64/src/ld/CMakeLists.txt b/ld64/src/ld/CMakeLists.txt index c314ff45..7a3fdc59 100644 --- a/ld64/src/ld/CMakeLists.txt +++ b/ld64/src/ld/CMakeLists.txt @@ -51,8 +51,13 @@ configure_file ( ) if(XTOOLS_TAPI_SUPPORT) - include_directories("${XTOOLS_TAPI_PATH}/include") - message(STATUS "*LD64* including ${XTOOLS_TAPI_PATH}/include") + if(XTOOLS_USE_TAPILITE) + include_directories("${CMAKE_SOURCE_DIR}/tapilite/include") + message(STATUS "*LD64* including ${CMAKE_SOURCE_DIR}/tapilite/include") + else() + include_directories("${XTOOLS_TAPI_PATH}/include") + message(STATUS "*LD64* including ${XTOOLS_TAPI_PATH}/include") + endif() endif() include_directories("${CMAKE_CURRENT_SOURCE_DIR}") @@ -62,10 +67,6 @@ if(XTOOLS_LTO_SUPPORT) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lLTO") endif() -if(XTOOLS_TAPI_SUPPORT) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ltapi") -endif() - add_definitions(-DLD_VERS="xtools-ld64-${LD64_VERSION_NUM}") add_executable(ld ${LD64_SOURCES}) @@ -73,4 +74,12 @@ if(NOT XTOOLS_HAS_MODERNXAR) target_link_libraries(ld xarextralib) endif() +if(XTOOLS_TAPI_SUPPORT) + if(XTOOLS_USE_TAPILITE) + target_link_libraries(ld tapilite yaml) + else() + target_link_libraries(ld tapi) + endif() +endif() + install(TARGETS ld DESTINATION bin) diff --git a/ld64/src/ld/HeaderAndLoadCommands.hpp b/ld64/src/ld/HeaderAndLoadCommands.hpp index 62358fbc..69f53a7b 100644 --- a/ld64/src/ld/HeaderAndLoadCommands.hpp +++ b/ld64/src/ld/HeaderAndLoadCommands.hpp @@ -1236,6 +1236,9 @@ uint8_t* HeaderAndLoadCommandsAtom::copyVersionLoadCommand(uint8_t* p) const case Options::kPlatform_bridgeOS: assert(0 && "bridgeOS uses LC_BUILD_VERSION"); break; + default: + assert(0 && "unknown platform"); + break; } return p + sizeof(macho_version_min_command

); } diff --git a/ld64/src/ld/InputFiles.cpp b/ld64/src/ld/InputFiles.cpp index 617d9d49..957a676f 100644 --- a/ld64/src/ld/InputFiles.cpp +++ b/ld64/src/ld/InputFiles.cpp @@ -907,6 +907,8 @@ void InputFiles::inferArchitecture(Options& opts, const char** archName) opts.setArchitecture(CPU_TYPE_X86_64, CPU_SUBTYPE_X86_64_ALL, Options::kPlatformOSX); #elif __arm__ opts.setArchitecture(CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V6, Options::kPlatformOSX); +#elif __arm64__ + opts.setArchitecture(CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_ALL, Options::kPlatformOSX); #else #error unknown default architecture #endif diff --git a/ld64/src/ld/Options.cpp b/ld64/src/ld/Options.cpp index a1f330b8..da8b0802 100644 --- a/ld64/src/ld/Options.cpp +++ b/ld64/src/ld/Options.cpp @@ -1771,7 +1771,7 @@ uint32_t Options::parseVersionNumber32(const char* versionString) z = strtoul(&end[1], &end, 10); } } - if ( (*end != '\0') || (x > 0xffff) || (y > 0xff) || (z > 0xff) ) + if ( (x > 0xffff) || (y > 0xff) || (z > 0xff) ) throwf("malformed 32-bit x.y.z version number: %s", versionString); return (x << 16) | ( y << 8 ) | z; diff --git a/ld64/src/ld/code-sign-blobs/blob.h b/ld64/src/ld/code-sign-blobs/blob.h index 19c63a9c..e922b4e2 100644 --- a/ld64/src/ld/code-sign-blobs/blob.h +++ b/ld64/src/ld/code-sign-blobs/blob.h @@ -181,7 +181,15 @@ class Blob: public BlobCore { } BlobType *clone() const - { assert(validateBlob()); return specific(this->BlobCore::clone()); } + { + assert(validateBlob()); + /* TODO: come up with a better preprocessor conditional: */ +#ifdef HAVE_Security_BlobCore_clone + return specific(this->BlobCore::clone()); +#else + return NULL; +#endif + } static BlobType *readBlob(int fd) { return specific(BlobCore::readBlob(fd, _magic, sizeof(BlobType), 0), true); } diff --git a/ld64/src/ld/parsers/archive_file.cpp b/ld64/src/ld/parsers/archive_file.cpp index c09c40a3..f13d3d67 100644 --- a/ld64/src/ld/parsers/archive_file.cpp +++ b/ld64/src/ld/parsers/archive_file.cpp @@ -514,6 +514,7 @@ bool File::forEachAtom(ld::File::AtomHandler& handler) const } } } +#ifdef LTO_SUPPORT else if ( validLTOFile(member->content(), member->contentSize(), _objOpts) ) { if ( lto::hasObjCCategory(member->content(), member->contentSize()) ) { MemberState& state = this->makeObjectFileForMember(member); @@ -525,6 +526,7 @@ bool File::forEachAtom(ld::File::AtomHandler& handler) const } } } +#endif } } return didSome; diff --git a/ld64/src/ld/parsers/libunwind/Registers.hpp b/ld64/src/ld/parsers/libunwind/Registers.hpp index ceacc286..c1119477 100644 --- a/ld64/src/ld/parsers/libunwind/Registers.hpp +++ b/ld64/src/ld/parsers/libunwind/Registers.hpp @@ -43,6 +43,55 @@ namespace libunwind { +#ifndef i386_thread_state_t +struct _i386_thread_state_t +{ + unsigned int __eax; + unsigned int __ebx; + unsigned int __ecx; + unsigned int __edx; + unsigned int __edi; + unsigned int __esi; + unsigned int __ebp; + unsigned int __esp; + unsigned int __ss; + unsigned int __eflags; + unsigned int __eip; + unsigned int __cs; + unsigned int __ds; + unsigned int __es; + unsigned int __fs; + unsigned int __gs; +}; +#define i386_thread_state_t _i386_thread_state_t +#endif +#ifndef x86_thread_state64_t +struct _x86_thread_state64_t +{ + __uint64_t __rax; + __uint64_t __rbx; + __uint64_t __rcx; + __uint64_t __rdx; + __uint64_t __rdi; + __uint64_t __rsi; + __uint64_t __rbp; + __uint64_t __rsp; + __uint64_t __r8; + __uint64_t __r9; + __uint64_t __r10; + __uint64_t __r11; + __uint64_t __r12; + __uint64_t __r13; + __uint64_t __r14; + __uint64_t __r15; + __uint64_t __rip; + __uint64_t __rflags; + __uint64_t __cs; + __uint64_t __fs; + __uint64_t __gs; +}; +#define x86_thread_state64_t _x86_thread_state64_t +#endif /// /// Registers_x86 holds the register state of a thread in a 32-bit intel process. /// diff --git a/ld64/src/other/unwinddump.cpp b/ld64/src/other/unwinddump.cpp index d77e5d9c..168ea675 100644 --- a/ld64/src/other/unwinddump.cpp +++ b/ld64/src/other/unwinddump.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/ld64/unit-tests/src/xmlparser/xmlparser.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ld64/unit-tests/src/xmlparser/xmlparser.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/ld64/unit-tests/src/xmlparser/xmlparser.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ld64/unit-tests/test-cases/Lpath/foo.c b/ld64/unit-tests/test-cases/Lpath/foo.c index 8c5841a6..ac71f2d2 100644 --- a/ld64/unit-tests/test-cases/Lpath/foo.c +++ b/ld64/unit-tests/test-cases/Lpath/foo.c @@ -1,2 +1,3 @@ -int foo() { return 0; } +int +foo (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/Lpath/main.c b/ld64/unit-tests/test-cases/Lpath/main.c index 49deebfb..f45f1c98 100644 --- a/ld64/unit-tests/test-cases/Lpath/main.c +++ b/ld64/unit-tests/test-cases/Lpath/main.c @@ -1,7 +1,8 @@ extern int foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/absolute-symbol/main.c b/ld64/unit-tests/test-cases/absolute-symbol/main.c index eec3f61d..dde67156 100644 --- a/ld64/unit-tests/test-cases/absolute-symbol/main.c +++ b/ld64/unit-tests/test-cases/absolute-symbol/main.c @@ -1,5 +1,6 @@ extern int* myAbs; -int main() { return *myAbs; } +int +main (void) { return *myAbs; } diff --git a/ld64/unit-tests/test-cases/alias-basic/main.c b/ld64/unit-tests/test-cases/alias-basic/main.c index d89f4217..38722c30 100644 --- a/ld64/unit-tests/test-cases/alias-basic/main.c +++ b/ld64/unit-tests/test-cases/alias-basic/main.c @@ -3,13 +3,15 @@ extern int result; int myresult = 1; -int mymain() +int +mymain (void) { bar(); return result; } -void mybar() +void +mybar (void) { } diff --git a/ld64/unit-tests/test-cases/align-modulus/foo.c b/ld64/unit-tests/test-cases/align-modulus/foo.c index 0b88dffe..6c33e29d 100644 --- a/ld64/unit-tests/test-cases/align-modulus/foo.c +++ b/ld64/unit-tests/test-cases/align-modulus/foo.c @@ -24,7 +24,8 @@ extern char b; int my = 2; -char foo() +char +foo (void) { return my+b; } diff --git a/ld64/unit-tests/test-cases/alt-entry/foo.c b/ld64/unit-tests/test-cases/alt-entry/foo.c index 1b1d09b9..84fdcf29 100644 --- a/ld64/unit-tests/test-cases/alt-entry/foo.c +++ b/ld64/unit-tests/test-cases/alt-entry/foo.c @@ -1,6 +1,7 @@ #include -int foo() +int +foo (void) { fprintf(stdout, "hello foo\n"); return 0; diff --git a/ld64/unit-tests/test-cases/alt-entry/main.c b/ld64/unit-tests/test-cases/alt-entry/main.c index 8af852ab..32cc7222 100644 --- a/ld64/unit-tests/test-cases/alt-entry/main.c +++ b/ld64/unit-tests/test-cases/alt-entry/main.c @@ -1,6 +1,7 @@ #include -int mymain() +int +mymain (void) { fprintf(stdout, "hello mymain\n"); return 0; diff --git a/ld64/unit-tests/test-cases/archive-ObjC/bar.c b/ld64/unit-tests/test-cases/archive-ObjC/bar.c index d9b468b6..5e69d163 100644 --- a/ld64/unit-tests/test-cases/archive-ObjC/bar.c +++ b/ld64/unit-tests/test-cases/archive-ObjC/bar.c @@ -1,2 +1,3 @@ -int bar() { return 0; } +int +bar (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-ObjC/main.c b/ld64/unit-tests/test-cases/archive-ObjC/main.c index dc2fbef0..832ee0a1 100644 --- a/ld64/unit-tests/test-cases/archive-ObjC/main.c +++ b/ld64/unit-tests/test-cases/archive-ObjC/main.c @@ -24,7 +24,8 @@ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/archive-basic/bar.c b/ld64/unit-tests/test-cases/archive-basic/bar.c index 7fe64038..831c7de9 100644 --- a/ld64/unit-tests/test-cases/archive-basic/bar.c +++ b/ld64/unit-tests/test-cases/archive-basic/bar.c @@ -1 +1,2 @@ -int bar() { return 0; } +int +bar (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-basic/foo.c b/ld64/unit-tests/test-cases/archive-basic/foo.c index a60f28c1..424cd33e 100644 --- a/ld64/unit-tests/test-cases/archive-basic/foo.c +++ b/ld64/unit-tests/test-cases/archive-basic/foo.c @@ -1 +1,2 @@ -int foo() { return 1; } +int +foo (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/archive-basic/main.c b/ld64/unit-tests/test-cases/archive-basic/main.c index 57c4c686..7c0783cb 100644 --- a/ld64/unit-tests/test-cases/archive-basic/main.c +++ b/ld64/unit-tests/test-cases/archive-basic/main.c @@ -25,7 +25,8 @@ extern int foo(); -int main() +int +main (void) { fprintf(stdout, "hello\n"); return foo(); diff --git a/ld64/unit-tests/test-cases/archive-duplicate/bar.c b/ld64/unit-tests/test-cases/archive-duplicate/bar.c index 7fe64038..831c7de9 100644 --- a/ld64/unit-tests/test-cases/archive-duplicate/bar.c +++ b/ld64/unit-tests/test-cases/archive-duplicate/bar.c @@ -1 +1,2 @@ -int bar() { return 0; } +int +bar (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-duplicate/foo.c b/ld64/unit-tests/test-cases/archive-duplicate/foo.c index a60f28c1..424cd33e 100644 --- a/ld64/unit-tests/test-cases/archive-duplicate/foo.c +++ b/ld64/unit-tests/test-cases/archive-duplicate/foo.c @@ -1 +1,2 @@ -int foo() { return 1; } +int +foo (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/archive-duplicate/main.c b/ld64/unit-tests/test-cases/archive-duplicate/main.c index 57c4c686..7c0783cb 100644 --- a/ld64/unit-tests/test-cases/archive-duplicate/main.c +++ b/ld64/unit-tests/test-cases/archive-duplicate/main.c @@ -25,7 +25,8 @@ extern int foo(); -int main() +int +main (void) { fprintf(stdout, "hello\n"); return foo(); diff --git a/ld64/unit-tests/test-cases/archive-force-load/bar.c b/ld64/unit-tests/test-cases/archive-force-load/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/archive-force-load/bar.c +++ b/ld64/unit-tests/test-cases/archive-force-load/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/archive-force-load/bat.c b/ld64/unit-tests/test-cases/archive-force-load/bat.c index f5a79569..fc9ac904 100644 --- a/ld64/unit-tests/test-cases/archive-force-load/bat.c +++ b/ld64/unit-tests/test-cases/archive-force-load/bat.c @@ -1 +1,2 @@ -void bat() {} +void +bat (void) {} diff --git a/ld64/unit-tests/test-cases/archive-force-load/baz.c b/ld64/unit-tests/test-cases/archive-force-load/baz.c index 4b361f63..28002ced 100644 --- a/ld64/unit-tests/test-cases/archive-force-load/baz.c +++ b/ld64/unit-tests/test-cases/archive-force-load/baz.c @@ -1,2 +1,3 @@ -void baz() {} +void +baz (void) {} diff --git a/ld64/unit-tests/test-cases/archive-force-load/foo.c b/ld64/unit-tests/test-cases/archive-force-load/foo.c index 85e6cd8c..4c76cef7 100644 --- a/ld64/unit-tests/test-cases/archive-force-load/foo.c +++ b/ld64/unit-tests/test-cases/archive-force-load/foo.c @@ -1 +1,2 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/archive-force-load/main.c b/ld64/unit-tests/test-cases/archive-force-load/main.c index fc047f75..0c53d8d2 100644 --- a/ld64/unit-tests/test-cases/archive-force-load/main.c +++ b/ld64/unit-tests/test-cases/archive-force-load/main.c @@ -1,5 +1,6 @@ -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-init-order/main.c b/ld64/unit-tests/test-cases/archive-init-order/main.c index 242b32a2..a9750dd3 100644 --- a/ld64/unit-tests/test-cases/archive-init-order/main.c +++ b/ld64/unit-tests/test-cases/archive-init-order/main.c @@ -29,7 +29,8 @@ extern int bar(); extern int bar2(); extern int bar3(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/archive-order/bar.c b/ld64/unit-tests/test-cases/archive-order/bar.c index 7fe64038..831c7de9 100644 --- a/ld64/unit-tests/test-cases/archive-order/bar.c +++ b/ld64/unit-tests/test-cases/archive-order/bar.c @@ -1 +1,2 @@ -int bar() { return 0; } +int +bar (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-order/bar2.c b/ld64/unit-tests/test-cases/archive-order/bar2.c index 54e8acef..bf7084c7 100644 --- a/ld64/unit-tests/test-cases/archive-order/bar2.c +++ b/ld64/unit-tests/test-cases/archive-order/bar2.c @@ -1 +1,2 @@ -int bar2() { return 0; } +int +bar2 (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-order/bar3.c b/ld64/unit-tests/test-cases/archive-order/bar3.c index 0b440577..1fcac58d 100644 --- a/ld64/unit-tests/test-cases/archive-order/bar3.c +++ b/ld64/unit-tests/test-cases/archive-order/bar3.c @@ -1 +1,2 @@ -int bar3() { return 0; } +int +bar3 (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-order/foo.c b/ld64/unit-tests/test-cases/archive-order/foo.c index a60f28c1..424cd33e 100644 --- a/ld64/unit-tests/test-cases/archive-order/foo.c +++ b/ld64/unit-tests/test-cases/archive-order/foo.c @@ -1 +1,2 @@ -int foo() { return 1; } +int +foo (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/archive-order/foo2.c b/ld64/unit-tests/test-cases/archive-order/foo2.c index 492879f9..3ed52a72 100644 --- a/ld64/unit-tests/test-cases/archive-order/foo2.c +++ b/ld64/unit-tests/test-cases/archive-order/foo2.c @@ -1 +1,2 @@ -int foo2() { return 1; } +int +foo2 (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/archive-order/foo3.c b/ld64/unit-tests/test-cases/archive-order/foo3.c index 1de0bce4..e3133ab8 100644 --- a/ld64/unit-tests/test-cases/archive-order/foo3.c +++ b/ld64/unit-tests/test-cases/archive-order/foo3.c @@ -1 +1,2 @@ -int foo3() { return 1; } +int +foo3 (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/archive-order/main.c b/ld64/unit-tests/test-cases/archive-order/main.c index 242b32a2..a9750dd3 100644 --- a/ld64/unit-tests/test-cases/archive-order/main.c +++ b/ld64/unit-tests/test-cases/archive-order/main.c @@ -29,7 +29,8 @@ extern int bar(); extern int bar2(); extern int bar3(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/archive-r-ObjC/bar.c b/ld64/unit-tests/test-cases/archive-r-ObjC/bar.c index d9b468b6..5e69d163 100644 --- a/ld64/unit-tests/test-cases/archive-r-ObjC/bar.c +++ b/ld64/unit-tests/test-cases/archive-r-ObjC/bar.c @@ -1,2 +1,3 @@ -int bar() { return 0; } +int +bar (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-r-ObjC/main.c b/ld64/unit-tests/test-cases/archive-r-ObjC/main.c index dc2fbef0..832ee0a1 100644 --- a/ld64/unit-tests/test-cases/archive-r-ObjC/main.c +++ b/ld64/unit-tests/test-cases/archive-r-ObjC/main.c @@ -24,7 +24,8 @@ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/archive-weak/bar.c b/ld64/unit-tests/test-cases/archive-weak/bar.c index 7fe64038..831c7de9 100644 --- a/ld64/unit-tests/test-cases/archive-weak/bar.c +++ b/ld64/unit-tests/test-cases/archive-weak/bar.c @@ -1 +1,2 @@ -int bar() { return 0; } +int +bar (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/archive-weak/baz.c b/ld64/unit-tests/test-cases/archive-weak/baz.c index 387ccc1f..a6340997 100644 --- a/ld64/unit-tests/test-cases/archive-weak/baz.c +++ b/ld64/unit-tests/test-cases/archive-weak/baz.c @@ -2,7 +2,8 @@ // intentionally not-weak -int baz() +int +baz (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/auto-arch/hello.c b/ld64/unit-tests/test-cases/auto-arch/hello.c index 463663a3..336d1fa0 100644 --- a/ld64/unit-tests/test-cases/auto-arch/hello.c +++ b/ld64/unit-tests/test-cases/auto-arch/hello.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/bind_at_load/bar.c b/ld64/unit-tests/test-cases/bind_at_load/bar.c index d4a10076..f0a9f9e2 100644 --- a/ld64/unit-tests/test-cases/bind_at_load/bar.c +++ b/ld64/unit-tests/test-cases/bind_at_load/bar.c @@ -1,2 +1,3 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/bind_at_load/foo.c b/ld64/unit-tests/test-cases/bind_at_load/foo.c index ed41e9b8..1b0b484c 100644 --- a/ld64/unit-tests/test-cases/bind_at_load/foo.c +++ b/ld64/unit-tests/test-cases/bind_at_load/foo.c @@ -1,3 +1,5 @@ -void foo() {} -void foo2() {} +void +foo (void) {} +void +foo2 (void) {} diff --git a/ld64/unit-tests/test-cases/branch-islands/extra.c b/ld64/unit-tests/test-cases/branch-islands/extra.c index 3f433922..b55657a9 100644 --- a/ld64/unit-tests/test-cases/branch-islands/extra.c +++ b/ld64/unit-tests/test-cases/branch-islands/extra.c @@ -2,7 +2,8 @@ extern void back(); -void foo() +void +foo (void) { fprintf(stdout, "foo\n"); back(); diff --git a/ld64/unit-tests/test-cases/branch-islands/hello.c b/ld64/unit-tests/test-cases/branch-islands/hello.c index 0738f0e8..cc9bb32d 100644 --- a/ld64/unit-tests/test-cases/branch-islands/hello.c +++ b/ld64/unit-tests/test-cases/branch-islands/hello.c @@ -2,13 +2,15 @@ extern void foo(); -int main() +int +main (void) { fprintf(stdout, "hello\n"); foo(); return 0; } -void back() +void +back (void) { } \ No newline at end of file diff --git a/ld64/unit-tests/test-cases/bundle_loader/bar.c b/ld64/unit-tests/test-cases/bundle_loader/bar.c index b7379533..3d42902e 100644 --- a/ld64/unit-tests/test-cases/bundle_loader/bar.c +++ b/ld64/unit-tests/test-cases/bundle_loader/bar.c @@ -24,7 +24,8 @@ // funcation called by a loaded bundle -int bar() +int +bar (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/bundle_loader/bundle.c b/ld64/unit-tests/test-cases/bundle_loader/bundle.c index ba78c287..07887ffa 100644 --- a/ld64/unit-tests/test-cases/bundle_loader/bundle.c +++ b/ld64/unit-tests/test-cases/bundle_loader/bundle.c @@ -25,7 +25,8 @@ extern int bar(); -int foo() +int +foo (void) { return bar(); } diff --git a/ld64/unit-tests/test-cases/bundle_loader/main.c b/ld64/unit-tests/test-cases/bundle_loader/main.c index c9e53f9b..425915c2 100644 --- a/ld64/unit-tests/test-cases/bundle_loader/main.c +++ b/ld64/unit-tests/test-cases/bundle_loader/main.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/cfstring-and-cstring/bar.c b/ld64/unit-tests/test-cases/cfstring-and-cstring/bar.c index 3441ce91..18c7d31a 100644 --- a/ld64/unit-tests/test-cases/cfstring-and-cstring/bar.c +++ b/ld64/unit-tests/test-cases/cfstring-and-cstring/bar.c @@ -8,7 +8,8 @@ const char kTest[] = "test"; -void bar() +void +bar (void) { CFStringGetLength(CFSTR("test")); } diff --git a/ld64/unit-tests/test-cases/cfstring-and-cstring/foo.c b/ld64/unit-tests/test-cases/cfstring-and-cstring/foo.c index 86b0d6e6..61f4ae73 100644 --- a/ld64/unit-tests/test-cases/cfstring-and-cstring/foo.c +++ b/ld64/unit-tests/test-cases/cfstring-and-cstring/foo.c @@ -2,7 +2,8 @@ extern void bar(); -int main() +int +main (void) { CFStringGetLength(CFSTR("stuff")); bar(); diff --git a/ld64/unit-tests/test-cases/cfstring-coalesce/bar.c b/ld64/unit-tests/test-cases/cfstring-coalesce/bar.c index b78cd63b..fe086fff 100644 --- a/ld64/unit-tests/test-cases/cfstring-coalesce/bar.c +++ b/ld64/unit-tests/test-cases/cfstring-coalesce/bar.c @@ -2,7 +2,8 @@ CFStringRef OtherCFString = CFSTR("other"); -void bar() +void +bar (void) { CFStringGetLength(CFSTR("live")); } diff --git a/ld64/unit-tests/test-cases/cfstring-coalesce/foo.c b/ld64/unit-tests/test-cases/cfstring-coalesce/foo.c index a5c794e4..fde783e8 100644 --- a/ld64/unit-tests/test-cases/cfstring-coalesce/foo.c +++ b/ld64/unit-tests/test-cases/cfstring-coalesce/foo.c @@ -4,7 +4,8 @@ extern void bar(); extern CFStringRef OtherCFString; -void foo() +void +foo (void) { CFStringGetLength(CFSTR("hello")); CFStringGetLength(CFSTR("world")); @@ -12,7 +13,8 @@ void foo() } -int main() +int +main (void) { CFStringGetLength(CFSTR("live")); bar(); diff --git a/ld64/unit-tests/test-cases/check-init-abs/main.c b/ld64/unit-tests/test-cases/check-init-abs/main.c index b54a2202..e2427b07 100644 --- a/ld64/unit-tests/test-cases/check-init-abs/main.c +++ b/ld64/unit-tests/test-cases/check-init-abs/main.c @@ -1,2 +1,3 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/check-init-bind/main.c b/ld64/unit-tests/test-cases/check-init-bind/main.c index b54a2202..e2427b07 100644 --- a/ld64/unit-tests/test-cases/check-init-bind/main.c +++ b/ld64/unit-tests/test-cases/check-init-bind/main.c @@ -1,2 +1,3 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/check-init-no-rebase/main.c b/ld64/unit-tests/test-cases/check-init-no-rebase/main.c index b54a2202..e2427b07 100644 --- a/ld64/unit-tests/test-cases/check-init-no-rebase/main.c +++ b/ld64/unit-tests/test-cases/check-init-no-rebase/main.c @@ -1,2 +1,3 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/code-signed-object-file/foo.c b/ld64/unit-tests/test-cases/code-signed-object-file/foo.c index 85e6cd8c..4c76cef7 100644 --- a/ld64/unit-tests/test-cases/code-signed-object-file/foo.c +++ b/ld64/unit-tests/test-cases/code-signed-object-file/foo.c @@ -1 +1,2 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/a.c b/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/a.c index fea72340..f1abb4f5 100644 --- a/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/a.c +++ b/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/a.c @@ -1,4 +1,5 @@ #include "c.h" -float aa() { return bar; } +float +aa (void) { return bar; } diff --git a/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/b.c b/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/b.c index 12e46e80..313c5484 100644 --- a/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/b.c +++ b/ld64/unit-tests/test-cases/commons-coalesced-dead_strip/b.c @@ -1,4 +1,5 @@ #include "c.h" -float bb() { return bar; } +float +bb (void) { return bar; } diff --git a/ld64/unit-tests/test-cases/commons-order/main.c b/ld64/unit-tests/test-cases/commons-order/main.c index df774481..3952f8dd 100644 --- a/ld64/unit-tests/test-cases/commons-order/main.c +++ b/ld64/unit-tests/test-cases/commons-order/main.c @@ -1,4 +1,5 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/cpu-sub-types-preference/foo.c b/ld64/unit-tests/test-cases/cpu-sub-types-preference/foo.c index 983ed81a..0a7ffb89 100644 --- a/ld64/unit-tests/test-cases/cpu-sub-types-preference/foo.c +++ b/ld64/unit-tests/test-cases/cpu-sub-types-preference/foo.c @@ -1,25 +1,31 @@ #if AAA - void aaa() {} + void +aaa (void) {} #endif #if BBB - void bbb() {} + void +bbb (void) {} #endif #if CCC - void ccc() {} + void +ccc (void) {} #endif #if DDD - void ddd() {} + void +ddd (void) {} #endif #if EEE - void eee() {} + void +eee (void) {} #endif #if FFFF - void fff() {} + void +fff (void) {} #endif diff --git a/ld64/unit-tests/test-cases/cpu-sub-types/foo.c b/ld64/unit-tests/test-cases/cpu-sub-types/foo.c index 3695dc91..4fa60295 100644 --- a/ld64/unit-tests/test-cases/cpu-sub-types/foo.c +++ b/ld64/unit-tests/test-cases/cpu-sub-types/foo.c @@ -1,3 +1,4 @@ -void foo() +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/cpu-sub-types/main.c b/ld64/unit-tests/test-cases/cpu-sub-types/main.c index b48076d3..9ecb9cc0 100644 --- a/ld64/unit-tests/test-cases/cpu-sub-types/main.c +++ b/ld64/unit-tests/test-cases/cpu-sub-types/main.c @@ -3,7 +3,8 @@ extern void foo(); extern void bar(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/cstring-alt-segment/main.c b/ld64/unit-tests/test-cases/cstring-alt-segment/main.c index 8fe18db6..46b3287f 100644 --- a/ld64/unit-tests/test-cases/cstring-alt-segment/main.c +++ b/ld64/unit-tests/test-cases/cstring-alt-segment/main.c @@ -1,6 +1,7 @@ #include -int main() +int +main (void) { printf("hello"); return 0; diff --git a/ld64/unit-tests/test-cases/cstring-labels/foo.c b/ld64/unit-tests/test-cases/cstring-labels/foo.c index 0780b62e..1432bec2 100644 --- a/ld64/unit-tests/test-cases/cstring-labels/foo.c +++ b/ld64/unit-tests/test-cases/cstring-labels/foo.c @@ -1,5 +1,6 @@ -void func() {} +void +func (void) {} const char kFoo[] = "foo"; diff --git a/ld64/unit-tests/test-cases/custom-segment-layout/main.c b/ld64/unit-tests/test-cases/custom-segment-layout/main.c index 7f59a231..64072765 100644 --- a/ld64/unit-tests/test-cases/custom-segment-layout/main.c +++ b/ld64/unit-tests/test-cases/custom-segment-layout/main.c @@ -1,7 +1,8 @@ int x = 5; -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/bar.c b/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/bar.c index 87526e5e..803e72c1 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/bar.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/bar.c @@ -1,7 +1,9 @@ -void bar() { } +void +bar (void) { } -int baz() +int +baz (void) { return -1; } diff --git a/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/foo.c b/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/foo.c index c8fcef26..0ba1ca78 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/foo.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/foo.c @@ -1,9 +1,11 @@ -void foo() { } +void +foo (void) { } extern void bar(); -void deadwood() +void +deadwood (void) { bar(); } diff --git a/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/main.c b/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/main.c index 1f74deb5..2c12d22f 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/main.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive-duplicate-def/main.c @@ -1,12 +1,14 @@ extern void foo(); -int baz() +int +baz (void) { return 0; } -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/dead_strip-archive-global/main.c b/ld64/unit-tests/test-cases/dead_strip-archive-global/main.c index da2b2fda..e862ef25 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive-global/main.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive-global/main.c @@ -24,7 +24,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/bar.c b/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/bar.c index 605e44e0..8acd6359 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/bar.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/bar.c @@ -1,6 +1,7 @@ -void bar() +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/foo.c b/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/foo.c index 92bcb8ff..74c28a91 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/foo.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive-weak-override/foo.c @@ -4,12 +4,14 @@ extern void bar(); // strong definition of foo overrides weak definition // in main.c, but this foo needs bar() -void foo() +void +foo (void) { bar(); } -void loadme() +void +loadme (void) { } diff --git a/ld64/unit-tests/test-cases/dead_strip-archive-weak/foo.c b/ld64/unit-tests/test-cases/dead_strip-archive-weak/foo.c index 79184c77..43f174c9 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive-weak/foo.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive-weak/foo.c @@ -1,12 +1,14 @@ extern void good(); -void foo() +void +foo (void) { good(); } -void loadme() +void +loadme (void) { // foo(); } diff --git a/ld64/unit-tests/test-cases/dead_strip-archive/foo.c b/ld64/unit-tests/test-cases/dead_strip-archive/foo.c index be1b4387..4bef4467 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive/foo.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive/foo.c @@ -1,6 +1,7 @@ -void foo() {} +void +foo (void) {} int my_common; diff --git a/ld64/unit-tests/test-cases/dead_strip-archive/main.c b/ld64/unit-tests/test-cases/dead_strip-archive/main.c index f6a7d5a6..e95cfaea 100644 --- a/ld64/unit-tests/test-cases/dead_strip-archive/main.c +++ b/ld64/unit-tests/test-cases/dead_strip-archive/main.c @@ -25,7 +25,8 @@ extern void foo(); extern int my_common; -int main() +int +main (void) { // the reference to the common symbol has to be first my_common += 1; diff --git a/ld64/unit-tests/test-cases/dead_strip-entry-archive/bar.c b/ld64/unit-tests/test-cases/dead_strip-entry-archive/bar.c index b348aa82..bdd9b760 100644 --- a/ld64/unit-tests/test-cases/dead_strip-entry-archive/bar.c +++ b/ld64/unit-tests/test-cases/dead_strip-entry-archive/bar.c @@ -1,4 +1,5 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/dead_strip-entry-archive/foo.c b/ld64/unit-tests/test-cases/dead_strip-entry-archive/foo.c index 95ec91c5..59a98896 100644 --- a/ld64/unit-tests/test-cases/dead_strip-entry-archive/foo.c +++ b/ld64/unit-tests/test-cases/dead_strip-entry-archive/foo.c @@ -1,6 +1,7 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/dead_strip-init-archive/bar.c b/ld64/unit-tests/test-cases/dead_strip-init-archive/bar.c index b348aa82..bdd9b760 100644 --- a/ld64/unit-tests/test-cases/dead_strip-init-archive/bar.c +++ b/ld64/unit-tests/test-cases/dead_strip-init-archive/bar.c @@ -1,4 +1,5 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/dead_strip-init-archive/foo.c b/ld64/unit-tests/test-cases/dead_strip-init-archive/foo.c index 95ec91c5..59a98896 100644 --- a/ld64/unit-tests/test-cases/dead_strip-init-archive/foo.c +++ b/ld64/unit-tests/test-cases/dead_strip-init-archive/foo.c @@ -1,6 +1,7 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/dead_strip-live-if-ref-live/main.c b/ld64/unit-tests/test-cases/dead_strip-live-if-ref-live/main.c index e038a284..ae67516d 100644 --- a/ld64/unit-tests/test-cases/dead_strip-live-if-ref-live/main.c +++ b/ld64/unit-tests/test-cases/dead_strip-live-if-ref-live/main.c @@ -5,7 +5,8 @@ int bb = 20; int cc = 30; -int main() +int +main (void) { printf("%p %p\n", &aa, &cc); return 0; diff --git a/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/baz.c b/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/baz.c index 7d76bddf..4ddeb7ef 100644 --- a/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/baz.c +++ b/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/baz.c @@ -1,4 +1,5 @@ -void baz() +void +baz (void) { } diff --git a/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/main.c b/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/main.c index e4c564cc..2c0db36e 100644 --- a/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/main.c +++ b/ld64/unit-tests/test-cases/dead_strip-weak-coalesce/main.c @@ -2,7 +2,8 @@ // baz is in a lazily loaded archive extern void baz(); -int main() +int +main (void) { baz(); return 0; diff --git a/ld64/unit-tests/test-cases/dead_strip/main.c b/ld64/unit-tests/test-cases/dead_strip/main.c index 029aed92..dec5e935 100644 --- a/ld64/unit-tests/test-cases/dead_strip/main.c +++ b/ld64/unit-tests/test-cases/dead_strip/main.c @@ -22,11 +22,13 @@ * @APPLE_LICENSE_HEADER_END@ */ -int main() +int +main (void) { return 0; } -void dead_door_knob() { } +void +dead_door_knob (void) { } diff --git a/ld64/unit-tests/test-cases/dead_strip_dylibs/main.c b/ld64/unit-tests/test-cases/dead_strip_dylibs/main.c index 2b85b0e1..b772bfab 100644 --- a/ld64/unit-tests/test-cases/dead_strip_dylibs/main.c +++ b/ld64/unit-tests/test-cases/dead_strip_dylibs/main.c @@ -1,7 +1,8 @@ extern void bar(); -int main() +int +main (void) { #if CALL_BAR bar(); diff --git a/ld64/unit-tests/test-cases/dead_strippable_dylib/main.c b/ld64/unit-tests/test-cases/dead_strippable_dylib/main.c index 4f56fe06..75eba75a 100644 --- a/ld64/unit-tests/test-cases/dead_strippable_dylib/main.c +++ b/ld64/unit-tests/test-cases/dead_strippable_dylib/main.c @@ -1,7 +1,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/dependency-logging/foo.c b/ld64/unit-tests/test-cases/dependency-logging/foo.c index 85e6cd8c..4c76cef7 100644 --- a/ld64/unit-tests/test-cases/dependency-logging/foo.c +++ b/ld64/unit-tests/test-cases/dependency-logging/foo.c @@ -1 +1,2 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/dependency-logging/main.c b/ld64/unit-tests/test-cases/dependency-logging/main.c index a5a79d52..854a1bb3 100644 --- a/ld64/unit-tests/test-cases/dependency-logging/main.c +++ b/ld64/unit-tests/test-cases/dependency-logging/main.c @@ -1,6 +1,7 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/dso_handle/test.c b/ld64/unit-tests/test-cases/dso_handle/test.c index 0b984b0b..8ae9474d 100644 --- a/ld64/unit-tests/test-cases/dso_handle/test.c +++ b/ld64/unit-tests/test-cases/dso_handle/test.c @@ -8,7 +8,8 @@ extern void* __dso_handle; #endif -int main() +int +main (void) { printf("dso_handle=%p\n", __dso_handle); return 0; diff --git a/ld64/unit-tests/test-cases/dtrace-old-probes/main.c b/ld64/unit-tests/test-cases/dtrace-old-probes/main.c index 811449a7..12c8889d 100644 --- a/ld64/unit-tests/test-cases/dtrace-old-probes/main.c +++ b/ld64/unit-tests/test-cases/dtrace-old-probes/main.c @@ -31,14 +31,16 @@ : \ ); -int deadwood() +int +deadwood (void) { DTRACE_CALL0ARGS(__foo__, test2) return 0; } -int main() { +int +main (void) { int a = 1; while(a) { diff --git a/ld64/unit-tests/test-cases/dtrace-static-probes/main.c b/ld64/unit-tests/test-cases/dtrace-static-probes/main.c index 79ce4ebb..b0521787 100644 --- a/ld64/unit-tests/test-cases/dtrace-static-probes/main.c +++ b/ld64/unit-tests/test-cases/dtrace-static-probes/main.c @@ -8,7 +8,8 @@ typedef int weirdType2; #include "bar.h" -int deadwood() +int +deadwood (void) { if ( BAR_COUNT1_ENABLED() ) BAR_COUNT1(2); @@ -16,7 +17,8 @@ int deadwood() } -int main() { +int +main (void) { int a = 1; while(a) { diff --git a/ld64/unit-tests/test-cases/duplicate_symbols/duplicates.c b/ld64/unit-tests/test-cases/duplicate_symbols/duplicates.c index 2a62979a..fd2d9460 100644 --- a/ld64/unit-tests/test-cases/duplicate_symbols/duplicates.c +++ b/ld64/unit-tests/test-cases/duplicate_symbols/duplicates.c @@ -1,10 +1,13 @@ #include -void a() { +void +a (void) { } -void b() { +void +b (void) { } -void c() { +void +c (void) { } diff --git a/ld64/unit-tests/test-cases/duplicate_symbols/main_extern.c b/ld64/unit-tests/test-cases/duplicate_symbols/main_extern.c index b78ea48c..21ce4f15 100644 --- a/ld64/unit-tests/test-cases/duplicate_symbols/main_extern.c +++ b/ld64/unit-tests/test-cases/duplicate_symbols/main_extern.c @@ -5,12 +5,15 @@ a separate compilation unit that also has a() and b(). extern void c(); -void a() { +void +a (void) { } -void b() { +void +b (void) { } -int main() { +int +main (void) { c(); } diff --git a/ld64/unit-tests/test-cases/duplicate_symbols/main_no_extern.c b/ld64/unit-tests/test-cases/duplicate_symbols/main_no_extern.c index cbdbeb61..dfe5b295 100644 --- a/ld64/unit-tests/test-cases/duplicate_symbols/main_no_extern.c +++ b/ld64/unit-tests/test-cases/duplicate_symbols/main_no_extern.c @@ -3,11 +3,14 @@ This file contains symbols that are duplicated in another file, but does not reference anything that would pull in the duplicates. */ -void a() { +void +a (void) { } -void b() { +void +b (void) { } -int main() { +int +main (void) { } diff --git a/ld64/unit-tests/test-cases/dwarf-archive-all_load/bar.c b/ld64/unit-tests/test-cases/dwarf-archive-all_load/bar.c index 06752f37..725c65ec 100644 --- a/ld64/unit-tests/test-cases/dwarf-archive-all_load/bar.c +++ b/ld64/unit-tests/test-cases/dwarf-archive-all_load/bar.c @@ -1,2 +1,3 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/dwarf-archive-all_load/baz.c b/ld64/unit-tests/test-cases/dwarf-archive-all_load/baz.c index 256a0e36..421abbc1 100644 --- a/ld64/unit-tests/test-cases/dwarf-archive-all_load/baz.c +++ b/ld64/unit-tests/test-cases/dwarf-archive-all_load/baz.c @@ -1 +1,2 @@ -void baz() {} +void +baz (void) {} diff --git a/ld64/unit-tests/test-cases/dwarf-archive-all_load/foo.c b/ld64/unit-tests/test-cases/dwarf-archive-all_load/foo.c index 85e6cd8c..4c76cef7 100644 --- a/ld64/unit-tests/test-cases/dwarf-archive-all_load/foo.c +++ b/ld64/unit-tests/test-cases/dwarf-archive-all_load/foo.c @@ -1 +1,2 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/dwarf-debug-notes-uuid/main.c b/ld64/unit-tests/test-cases/dwarf-debug-notes-uuid/main.c index 6ff8d4b0..e440d793 100644 --- a/ld64/unit-tests/test-cases/dwarf-debug-notes-uuid/main.c +++ b/ld64/unit-tests/test-cases/dwarf-debug-notes-uuid/main.c @@ -1,19 +1,22 @@ -void foo() +void +foo (void) { } -void bar() +void +bar (void) { foo(); } -int main() +int +main (void) { bar(); return 0; diff --git a/ld64/unit-tests/test-cases/dwarf-ignore/hello.c b/ld64/unit-tests/test-cases/dwarf-ignore/hello.c index 4750b51f..c92191b9 100644 --- a/ld64/unit-tests/test-cases/dwarf-ignore/hello.c +++ b/ld64/unit-tests/test-cases/dwarf-ignore/hello.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/dwarf-strip/hello.c b/ld64/unit-tests/test-cases/dwarf-strip/hello.c index 68509d71..74fe1763 100644 --- a/ld64/unit-tests/test-cases/dwarf-strip/hello.c +++ b/ld64/unit-tests/test-cases/dwarf-strip/hello.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/dylib-aliases/bar.c b/ld64/unit-tests/test-cases/dylib-aliases/bar.c index 981110fd..b268bcc5 100644 --- a/ld64/unit-tests/test-cases/dylib-aliases/bar.c +++ b/ld64/unit-tests/test-cases/dylib-aliases/bar.c @@ -1 +1,2 @@ -void bar() { } +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/dylib-aliases/foo.c b/ld64/unit-tests/test-cases/dylib-aliases/foo.c index 2fb55eed..7d06dbf8 100644 --- a/ld64/unit-tests/test-cases/dylib-aliases/foo.c +++ b/ld64/unit-tests/test-cases/dylib-aliases/foo.c @@ -1 +1,2 @@ -void foo() { } +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/dylib-aliases/main.c b/ld64/unit-tests/test-cases/dylib-aliases/main.c index 03c4b396..92d00008 100644 --- a/ld64/unit-tests/test-cases/dylib-aliases/main.c +++ b/ld64/unit-tests/test-cases/dylib-aliases/main.c @@ -1,7 +1,8 @@ extern void foo(); extern void bar(); -int main() { +int +main (void) { foo(); bar(); return 0; diff --git a/ld64/unit-tests/test-cases/dylib-main/foo.c b/ld64/unit-tests/test-cases/dylib-main/foo.c index 85e6cd8c..4c76cef7 100644 --- a/ld64/unit-tests/test-cases/dylib-main/foo.c +++ b/ld64/unit-tests/test-cases/dylib-main/foo.c @@ -1 +1,2 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/dylib-main/main.c b/ld64/unit-tests/test-cases/dylib-main/main.c index a444c65b..3970cd36 100644 --- a/ld64/unit-tests/test-cases/dylib-main/main.c +++ b/ld64/unit-tests/test-cases/dylib-main/main.c @@ -1,6 +1,7 @@ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/dylib-re-export-cycle/bar.c b/ld64/unit-tests/test-cases/dylib-re-export-cycle/bar.c index 981110fd..b268bcc5 100644 --- a/ld64/unit-tests/test-cases/dylib-re-export-cycle/bar.c +++ b/ld64/unit-tests/test-cases/dylib-re-export-cycle/bar.c @@ -1 +1,2 @@ -void bar() { } +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/dylib-re-export-cycle/foo.c b/ld64/unit-tests/test-cases/dylib-re-export-cycle/foo.c index 2fb55eed..7d06dbf8 100644 --- a/ld64/unit-tests/test-cases/dylib-re-export-cycle/foo.c +++ b/ld64/unit-tests/test-cases/dylib-re-export-cycle/foo.c @@ -1 +1,2 @@ -void foo() { } +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/dylib-re-export-cycle/main.c b/ld64/unit-tests/test-cases/dylib-re-export-cycle/main.c index 8273541a..abf35ef0 100644 --- a/ld64/unit-tests/test-cases/dylib-re-export-cycle/main.c +++ b/ld64/unit-tests/test-cases/dylib-re-export-cycle/main.c @@ -1,6 +1,7 @@ extern void unfindable(); -int main() { +int +main (void) { unfindable(); return 0; } diff --git a/ld64/unit-tests/test-cases/dylib-upward/bar.c b/ld64/unit-tests/test-cases/dylib-upward/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/dylib-upward/bar.c +++ b/ld64/unit-tests/test-cases/dylib-upward/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/dylib-upward/foo.c b/ld64/unit-tests/test-cases/dylib-upward/foo.c index bf74f093..73530f77 100644 --- a/ld64/unit-tests/test-cases/dylib-upward/foo.c +++ b/ld64/unit-tests/test-cases/dylib-upward/foo.c @@ -1,6 +1,7 @@ extern void bar(); -void foo() +void +foo (void) { bar(); } diff --git a/ld64/unit-tests/test-cases/dylib_file-missing/bar.c b/ld64/unit-tests/test-cases/dylib_file-missing/bar.c index 2668f9af..9cf09f13 100644 --- a/ld64/unit-tests/test-cases/dylib_file-missing/bar.c +++ b/ld64/unit-tests/test-cases/dylib_file-missing/bar.c @@ -1,12 +1,14 @@ -void bar() +void +bar (void) { } #if BAR_EXTRA -void bar_extra() +void +bar_extra (void) { } #endif diff --git a/ld64/unit-tests/test-cases/dylib_file-missing/foo.c b/ld64/unit-tests/test-cases/dylib_file-missing/foo.c index aa31241a..c8ce01d5 100644 --- a/ld64/unit-tests/test-cases/dylib_file-missing/foo.c +++ b/ld64/unit-tests/test-cases/dylib_file-missing/foo.c @@ -1,7 +1,8 @@ extern void bar(); -void foo() +void +foo (void) { bar(); } diff --git a/ld64/unit-tests/test-cases/dylib_file-missing/main.c b/ld64/unit-tests/test-cases/dylib_file-missing/main.c index 3f109f22..d32bb991 100644 --- a/ld64/unit-tests/test-cases/dylib_file-missing/main.c +++ b/ld64/unit-tests/test-cases/dylib_file-missing/main.c @@ -3,7 +3,8 @@ extern void foo(); extern void bar(); extern void bar_extra(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/dylib_file/bar.c b/ld64/unit-tests/test-cases/dylib_file/bar.c index 2668f9af..9cf09f13 100644 --- a/ld64/unit-tests/test-cases/dylib_file/bar.c +++ b/ld64/unit-tests/test-cases/dylib_file/bar.c @@ -1,12 +1,14 @@ -void bar() +void +bar (void) { } #if BAR_EXTRA -void bar_extra() +void +bar_extra (void) { } #endif diff --git a/ld64/unit-tests/test-cases/dylib_file/foo.c b/ld64/unit-tests/test-cases/dylib_file/foo.c index aa31241a..c8ce01d5 100644 --- a/ld64/unit-tests/test-cases/dylib_file/foo.c +++ b/ld64/unit-tests/test-cases/dylib_file/foo.c @@ -1,7 +1,8 @@ extern void bar(); -void foo() +void +foo (void) { bar(); } diff --git a/ld64/unit-tests/test-cases/dylib_file/main.c b/ld64/unit-tests/test-cases/dylib_file/main.c index 3f109f22..d32bb991 100644 --- a/ld64/unit-tests/test-cases/dylib_file/main.c +++ b/ld64/unit-tests/test-cases/dylib_file/main.c @@ -3,7 +3,8 @@ extern void foo(); extern void bar(); extern void bar_extra(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/dylib_init/foo.c b/ld64/unit-tests/test-cases/dylib_init/foo.c index 9ba156e7..d4a54380 100644 --- a/ld64/unit-tests/test-cases/dylib_init/foo.c +++ b/ld64/unit-tests/test-cases/dylib_init/foo.c @@ -1,2 +1,3 @@ -void _init() { +void +_init (void) { } diff --git a/ld64/unit-tests/test-cases/empty-object/main.c b/ld64/unit-tests/test-cases/empty-object/main.c index 76e81970..07e058cb 100644 --- a/ld64/unit-tests/test-cases/empty-object/main.c +++ b/ld64/unit-tests/test-cases/empty-object/main.c @@ -1 +1,2 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/exported-symbols-dead_strip/foo.c b/ld64/unit-tests/test-cases/exported-symbols-dead_strip/foo.c index 6bb8d95c..1b6a9e22 100644 --- a/ld64/unit-tests/test-cases/exported-symbols-dead_strip/foo.c +++ b/ld64/unit-tests/test-cases/exported-symbols-dead_strip/foo.c @@ -23,12 +23,18 @@ */ #include -void good() {} -void bad() {} +void +good (void) {} +void +bad (void) {} -void ABC() {} -void ABD() { good(); } -void DEF() {} -void DEG() { bad(); } +void +ABC (void) {} +void +ABD (void) { good(); } +void +DEF (void) {} +void +DEG (void) { bad(); } diff --git a/ld64/unit-tests/test-cases/exported-symbols-wildcards-dead_strip/foo.c b/ld64/unit-tests/test-cases/exported-symbols-wildcards-dead_strip/foo.c index 6bb8d95c..1b6a9e22 100644 --- a/ld64/unit-tests/test-cases/exported-symbols-wildcards-dead_strip/foo.c +++ b/ld64/unit-tests/test-cases/exported-symbols-wildcards-dead_strip/foo.c @@ -23,12 +23,18 @@ */ #include -void good() {} -void bad() {} +void +good (void) {} +void +bad (void) {} -void ABC() {} -void ABD() { good(); } -void DEF() {} -void DEG() { bad(); } +void +ABC (void) {} +void +ABD (void) { good(); } +void +DEF (void) {} +void +DEG (void) { bad(); } diff --git a/ld64/unit-tests/test-cases/exported-symbols-wildcards/foo.c b/ld64/unit-tests/test-cases/exported-symbols-wildcards/foo.c index bc5be8e9..5ef33876 100644 --- a/ld64/unit-tests/test-cases/exported-symbols-wildcards/foo.c +++ b/ld64/unit-tests/test-cases/exported-symbols-wildcards/foo.c @@ -24,32 +24,38 @@ #include -int foo() +int +foo (void) { return 1; } -int foo2() +int +foo2 (void) { return 1; } -int foobar() +int +foobar (void) { return 1; } -int foo2bar() +int +foo2bar (void) { return 1; } -int fao() +int +fao (void) { return 1; } -int ffo() +int +ffo (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/external-reloc-sorting/main.c b/ld64/unit-tests/test-cases/external-reloc-sorting/main.c index 6c68c4ca..a38a56c7 100644 --- a/ld64/unit-tests/test-cases/external-reloc-sorting/main.c +++ b/ld64/unit-tests/test-cases/external-reloc-sorting/main.c @@ -33,7 +33,8 @@ extern int baz; int* array[] = { &foo, &bar, &baz, &foo, &bar, &baz, &foo, &bar, &baz }; -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/fatal_warning/main.c b/ld64/unit-tests/test-cases/fatal_warning/main.c index fc047f75..0c53d8d2 100644 --- a/ld64/unit-tests/test-cases/fatal_warning/main.c +++ b/ld64/unit-tests/test-cases/fatal_warning/main.c @@ -1,5 +1,6 @@ -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/filelist/hello.c b/ld64/unit-tests/test-cases/filelist/hello.c index 463663a3..336d1fa0 100644 --- a/ld64/unit-tests/test-cases/filelist/hello.c +++ b/ld64/unit-tests/test-cases/filelist/hello.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/flat-dylib/main.c b/ld64/unit-tests/test-cases/flat-dylib/main.c index affbf906..60b3dcfb 100644 --- a/ld64/unit-tests/test-cases/flat-dylib/main.c +++ b/ld64/unit-tests/test-cases/flat-dylib/main.c @@ -23,10 +23,12 @@ */ #include -void foo() {} +void +foo (void) {} -int main() +int +main (void) { foo(); fprintf(stdout, "hello\n"); diff --git a/ld64/unit-tests/test-cases/flat-indirect-undefines/bar.c b/ld64/unit-tests/test-cases/flat-indirect-undefines/bar.c index b348aa82..bdd9b760 100644 --- a/ld64/unit-tests/test-cases/flat-indirect-undefines/bar.c +++ b/ld64/unit-tests/test-cases/flat-indirect-undefines/bar.c @@ -1,4 +1,5 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/flat-indirect-undefines/foo.c b/ld64/unit-tests/test-cases/flat-indirect-undefines/foo.c index 39df2eaa..7b259127 100644 --- a/ld64/unit-tests/test-cases/flat-indirect-undefines/foo.c +++ b/ld64/unit-tests/test-cases/flat-indirect-undefines/foo.c @@ -1,7 +1,8 @@ extern void bar(); -void foo() +void +foo (void) { bar(); } diff --git a/ld64/unit-tests/test-cases/flat-indirect-undefines/main.c b/ld64/unit-tests/test-cases/flat-indirect-undefines/main.c index 246fed46..5c355c31 100644 --- a/ld64/unit-tests/test-cases/flat-indirect-undefines/main.c +++ b/ld64/unit-tests/test-cases/flat-indirect-undefines/main.c @@ -3,7 +3,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/flat-main/main.c b/ld64/unit-tests/test-cases/flat-main/main.c index affbf906..60b3dcfb 100644 --- a/ld64/unit-tests/test-cases/flat-main/main.c +++ b/ld64/unit-tests/test-cases/flat-main/main.c @@ -23,10 +23,12 @@ */ #include -void foo() {} +void +foo (void) {} -int main() +int +main (void) { foo(); fprintf(stdout, "hello\n"); diff --git a/ld64/unit-tests/test-cases/force-weak/test.c b/ld64/unit-tests/test-cases/force-weak/test.c index bd0da124..8f09a9c8 100644 --- a/ld64/unit-tests/test-cases/force-weak/test.c +++ b/ld64/unit-tests/test-cases/force-weak/test.c @@ -1,5 +1,6 @@ extern int foo; -int getfoo() { return foo; } +int +getfoo (void) { return foo; } diff --git a/ld64/unit-tests/test-cases/function-starts/main.c b/ld64/unit-tests/test-cases/function-starts/main.c index be69aaaf..425719c3 100644 --- a/ld64/unit-tests/test-cases/function-starts/main.c +++ b/ld64/unit-tests/test-cases/function-starts/main.c @@ -1,14 +1,19 @@ -void foo() {} +void +foo (void) {} -void mid() {} +void +mid (void) {} -static void bar() { foo(); } +static void +bar (void) { foo(); } -int main() { bar(); return 0; } +int +main (void) { bar(); return 0; } #if __STATIC__ -void myexit() {} +void +myexit (void) {} #endif diff --git a/ld64/unit-tests/test-cases/got-elimination/foo.c b/ld64/unit-tests/test-cases/got-elimination/foo.c index 45675a3c..8c995f10 100644 --- a/ld64/unit-tests/test-cases/got-elimination/foo.c +++ b/ld64/unit-tests/test-cases/got-elimination/foo.c @@ -26,17 +26,20 @@ extern int bar1; extern int bar2; // just under 2GB array extern int bar3; -int getbar1() +int +getbar1 (void) { return bar1; } -int getbar2() +int +getbar2 (void) { return bar2; } -int getbar3() +int +getbar3 (void) { return bar3; } diff --git a/ld64/unit-tests/test-cases/header-pad/hello.c b/ld64/unit-tests/test-cases/header-pad/hello.c index 463663a3..336d1fa0 100644 --- a/ld64/unit-tests/test-cases/header-pad/hello.c +++ b/ld64/unit-tests/test-cases/header-pad/hello.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/hello-world/hello.c b/ld64/unit-tests/test-cases/hello-world/hello.c index 4750b51f..c92191b9 100644 --- a/ld64/unit-tests/test-cases/hello-world/hello.c +++ b/ld64/unit-tests/test-cases/hello-world/hello.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/hidden-r/main.c b/ld64/unit-tests/test-cases/hidden-r/main.c index 352c2f83..99a25a6a 100644 --- a/ld64/unit-tests/test-cases/hidden-r/main.c +++ b/ld64/unit-tests/test-cases/hidden-r/main.c @@ -3,7 +3,8 @@ extern void my_weak(); extern int my_tent; -int main() +int +main (void) { my_tent = 0; my_weak(); diff --git a/ld64/unit-tests/test-cases/implicit_dylib/bar.c b/ld64/unit-tests/test-cases/implicit_dylib/bar.c index e2164a2d..29ca08b4 100644 --- a/ld64/unit-tests/test-cases/implicit_dylib/bar.c +++ b/ld64/unit-tests/test-cases/implicit_dylib/bar.c @@ -1,7 +1,8 @@ -void bar() +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/implicit_dylib/foo.c b/ld64/unit-tests/test-cases/implicit_dylib/foo.c index 16247579..ae1d5939 100644 --- a/ld64/unit-tests/test-cases/implicit_dylib/foo.c +++ b/ld64/unit-tests/test-cases/implicit_dylib/foo.c @@ -1,5 +1,6 @@ -void foo() +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/implicit_dylib/main.c b/ld64/unit-tests/test-cases/implicit_dylib/main.c index 1f503535..b86b6369 100644 --- a/ld64/unit-tests/test-cases/implicit_dylib/main.c +++ b/ld64/unit-tests/test-cases/implicit_dylib/main.c @@ -2,7 +2,8 @@ extern void foo(); extern void bar(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/indirect-dylib/bar.c b/ld64/unit-tests/test-cases/indirect-dylib/bar.c index f39ee212..34e981e4 100644 --- a/ld64/unit-tests/test-cases/indirect-dylib/bar.c +++ b/ld64/unit-tests/test-cases/indirect-dylib/bar.c @@ -24,7 +24,8 @@ // function called by a loaded bundle -int bar() +int +bar (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/indirect-dylib/foo.c b/ld64/unit-tests/test-cases/indirect-dylib/foo.c index ba78c287..07887ffa 100644 --- a/ld64/unit-tests/test-cases/indirect-dylib/foo.c +++ b/ld64/unit-tests/test-cases/indirect-dylib/foo.c @@ -25,7 +25,8 @@ extern int bar(); -int foo() +int +foo (void) { return bar(); } diff --git a/ld64/unit-tests/test-cases/indirect-dylib/main.c b/ld64/unit-tests/test-cases/indirect-dylib/main.c index 13f57d75..4cabb1d8 100644 --- a/ld64/unit-tests/test-cases/indirect-dylib/main.c +++ b/ld64/unit-tests/test-cases/indirect-dylib/main.c @@ -25,7 +25,8 @@ extern void bar(); -int main() +int +main (void) { bar(); return 0; diff --git a/ld64/unit-tests/test-cases/install-name-override/foo.c b/ld64/unit-tests/test-cases/install-name-override/foo.c index 1a682603..f0c86862 100644 --- a/ld64/unit-tests/test-cases/install-name-override/foo.c +++ b/ld64/unit-tests/test-cases/install-name-override/foo.c @@ -1,5 +1,6 @@ -int foo() +int +foo (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/install-name-override/main.c b/ld64/unit-tests/test-cases/install-name-override/main.c index 7f346c1f..d39a6bf0 100644 --- a/ld64/unit-tests/test-cases/install-name-override/main.c +++ b/ld64/unit-tests/test-cases/install-name-override/main.c @@ -1,7 +1,8 @@ extern int foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/interposable_list/test.c b/ld64/unit-tests/test-cases/interposable_list/test.c index 937420e6..2384c02e 100644 --- a/ld64/unit-tests/test-cases/interposable_list/test.c +++ b/ld64/unit-tests/test-cases/interposable_list/test.c @@ -25,27 +25,32 @@ const char kMyStr[] = "hello"; -int test1() +int +test1 (void) { return 10; } -int test2() +int +test2 (void) { return 10; } -int test3() +int +test3 (void) { return 10; } -int test4() +int +test4 (void) { return 10; } -const char* getstr() +const char * +getstr (void) { test1(); test2(); diff --git a/ld64/unit-tests/test-cases/kext-undefined-export/mykext.c b/ld64/unit-tests/test-cases/kext-undefined-export/mykext.c index d01996fc..cce29ccb 100644 --- a/ld64/unit-tests/test-cases/kext-undefined-export/mykext.c +++ b/ld64/unit-tests/test-cases/kext-undefined-export/mykext.c @@ -22,6 +22,7 @@ kern_return_t mykext_stop (kmod_info_t * ki, void * d) { return KERN_SUCCESS; } -void my_dead_code() { +void +my_dead_code (void) { ++extern_unused_global; } \ No newline at end of file diff --git a/ld64/unit-tests/test-cases/large-data/test1.c b/ld64/unit-tests/test-cases/large-data/test1.c index 2d9ec940..bad4ee92 100644 --- a/ld64/unit-tests/test-cases/large-data/test1.c +++ b/ld64/unit-tests/test-cases/large-data/test1.c @@ -26,17 +26,20 @@ int mediumarray1[1000]; int bigarray1[500000000]; // just under 2GB array int small1; -int getbig1() +int +getbig1 (void) { return bigarray1[0]; } -int getmedium1() +int +getmedium1 (void) { return mediumarray1[0]; } -int getsmall1() +int +getsmall1 (void) { return small1; } diff --git a/ld64/unit-tests/test-cases/large-data/test2.c b/ld64/unit-tests/test-cases/large-data/test2.c index d97bed1b..95a278c5 100644 --- a/ld64/unit-tests/test-cases/large-data/test2.c +++ b/ld64/unit-tests/test-cases/large-data/test2.c @@ -25,13 +25,15 @@ int bigarray2[500000000]; // just under 2GB array int small2; -int getbig2() +int +getbig2 (void) { return bigarray2[0]; } -int getsmall2() +int +getsmall2 (void) { return small2; } diff --git a/ld64/unit-tests/test-cases/large-data/test3.c b/ld64/unit-tests/test-cases/large-data/test3.c index b7ca398d..687b347c 100644 --- a/ld64/unit-tests/test-cases/large-data/test3.c +++ b/ld64/unit-tests/test-cases/large-data/test3.c @@ -25,13 +25,15 @@ int bigarray3[500000000]; // just under 2GB array int small3; -int getbig3() +int +getbig3 (void) { return bigarray3[0]; } -int getsmall3() +int +getsmall3 (void) { return small3; } diff --git a/ld64/unit-tests/test-cases/large-data/test4.c b/ld64/unit-tests/test-cases/large-data/test4.c index d879c5ca..203817c1 100644 --- a/ld64/unit-tests/test-cases/large-data/test4.c +++ b/ld64/unit-tests/test-cases/large-data/test4.c @@ -25,13 +25,15 @@ int bigarray4[500000000]; // just under 2GB array int small4; -int getbig4() +int +getbig4 (void) { return bigarray4[0]; } -int getsmall4() +int +getsmall4 (void) { return small4; } diff --git a/ld64/unit-tests/test-cases/lazy-dylib/bad.c b/ld64/unit-tests/test-cases/lazy-dylib/bad.c index 59a13fbc..40f7f71d 100644 --- a/ld64/unit-tests/test-cases/lazy-dylib/bad.c +++ b/ld64/unit-tests/test-cases/lazy-dylib/bad.c @@ -6,7 +6,8 @@ extern int data; static int* pd = &data; -int main() +int +main (void) { return *pd; } diff --git a/ld64/unit-tests/test-cases/lazy-dylib/bad2.c b/ld64/unit-tests/test-cases/lazy-dylib/bad2.c index ffd2ce18..061b7bfb 100644 --- a/ld64/unit-tests/test-cases/lazy-dylib/bad2.c +++ b/ld64/unit-tests/test-cases/lazy-dylib/bad2.c @@ -4,7 +4,8 @@ extern int foo(); -int main() +int +main (void) { int (*func)() = foo; if ( func != NULL ) diff --git a/ld64/unit-tests/test-cases/lazy-dylib/foo.c b/ld64/unit-tests/test-cases/lazy-dylib/foo.c index c23c9dc7..fe0b4aad 100644 --- a/ld64/unit-tests/test-cases/lazy-dylib/foo.c +++ b/ld64/unit-tests/test-cases/lazy-dylib/foo.c @@ -1,5 +1,7 @@ int data = 5; -int foo() { return 1; } -int bar() { return 1; } +int +foo (void) { return 1; } +int +bar (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/lazy-dylib/main.c b/ld64/unit-tests/test-cases/lazy-dylib/main.c index 85468541..cf246ae6 100644 --- a/ld64/unit-tests/test-cases/lazy-dylib/main.c +++ b/ld64/unit-tests/test-cases/lazy-dylib/main.c @@ -5,7 +5,8 @@ extern int foo(); extern int bar(); -int main() +int +main (void) { // two regular external function calls void* x = malloc(16); diff --git a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/bar.c b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/bar.c index 981110fd..b268bcc5 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/bar.c +++ b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/bar.c @@ -1 +1,2 @@ -void bar() { } +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/baz.c b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/baz.c index a6dd5ab8..697038ae 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/baz.c +++ b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/baz.c @@ -1 +1,2 @@ -void baz() { } +void +baz (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/foo.c b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/foo.c index ab39b78d..57064f49 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/foo.c +++ b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/foo.c @@ -2,7 +2,8 @@ extern void bar(); extern void baz(); -void foo() { +void +foo (void) { bar(); baz(); } diff --git a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/main.c b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/main.c index 4f56fe06..75eba75a 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework-static-chain/main.c +++ b/ld64/unit-tests/test-cases/linker_options-framework-static-chain/main.c @@ -1,7 +1,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/linker_options-framework-static/foo.c b/ld64/unit-tests/test-cases/linker_options-framework-static/foo.c index e7048700..80870569 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework-static/foo.c +++ b/ld64/unit-tests/test-cases/linker_options-framework-static/foo.c @@ -1,3 +1,4 @@ -void foo() { } +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-framework-static/main.c b/ld64/unit-tests/test-cases/linker_options-framework-static/main.c index 4f56fe06..75eba75a 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework-static/main.c +++ b/ld64/unit-tests/test-cases/linker_options-framework-static/main.c @@ -1,7 +1,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/linker_options-framework/foo.c b/ld64/unit-tests/test-cases/linker_options-framework/foo.c index e7048700..80870569 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework/foo.c +++ b/ld64/unit-tests/test-cases/linker_options-framework/foo.c @@ -1,3 +1,4 @@ -void foo() { } +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-framework/main.c b/ld64/unit-tests/test-cases/linker_options-framework/main.c index 4f56fe06..75eba75a 100644 --- a/ld64/unit-tests/test-cases/linker_options-framework/main.c +++ b/ld64/unit-tests/test-cases/linker_options-framework/main.c @@ -1,7 +1,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/linker_options-library-chain/bar.c b/ld64/unit-tests/test-cases/linker_options-library-chain/bar.c index 981110fd..b268bcc5 100644 --- a/ld64/unit-tests/test-cases/linker_options-library-chain/bar.c +++ b/ld64/unit-tests/test-cases/linker_options-library-chain/bar.c @@ -1 +1,2 @@ -void bar() { } +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-library-chain/foo.c b/ld64/unit-tests/test-cases/linker_options-library-chain/foo.c index ac077b90..39767b8a 100644 --- a/ld64/unit-tests/test-cases/linker_options-library-chain/foo.c +++ b/ld64/unit-tests/test-cases/linker_options-library-chain/foo.c @@ -2,7 +2,8 @@ extern void bar(); extern void subbar(); -void foo() { +void +foo (void) { bar(); subbar(); } diff --git a/ld64/unit-tests/test-cases/linker_options-library-chain/main.c b/ld64/unit-tests/test-cases/linker_options-library-chain/main.c index 4f56fe06..75eba75a 100644 --- a/ld64/unit-tests/test-cases/linker_options-library-chain/main.c +++ b/ld64/unit-tests/test-cases/linker_options-library-chain/main.c @@ -1,7 +1,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/linker_options-library-chain/subbar.c b/ld64/unit-tests/test-cases/linker_options-library-chain/subbar.c index 3619a80b..13c4edde 100644 --- a/ld64/unit-tests/test-cases/linker_options-library-chain/subbar.c +++ b/ld64/unit-tests/test-cases/linker_options-library-chain/subbar.c @@ -1 +1,2 @@ -void subbar() { } +void +subbar (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-library/bar.c b/ld64/unit-tests/test-cases/linker_options-library/bar.c index 981110fd..b268bcc5 100644 --- a/ld64/unit-tests/test-cases/linker_options-library/bar.c +++ b/ld64/unit-tests/test-cases/linker_options-library/bar.c @@ -1 +1,2 @@ -void bar() { } +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-library/foo.c b/ld64/unit-tests/test-cases/linker_options-library/foo.c index e7048700..80870569 100644 --- a/ld64/unit-tests/test-cases/linker_options-library/foo.c +++ b/ld64/unit-tests/test-cases/linker_options-library/foo.c @@ -1,3 +1,4 @@ -void foo() { } +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/linker_options-library/main.c b/ld64/unit-tests/test-cases/linker_options-library/main.c index 594cf170..873ad0a3 100644 --- a/ld64/unit-tests/test-cases/linker_options-library/main.c +++ b/ld64/unit-tests/test-cases/linker_options-library/main.c @@ -2,7 +2,8 @@ extern void foo(); extern void bar(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/llvm-integration/a.c b/ld64/unit-tests/test-cases/llvm-integration/a.c index 0c961786..144c16c3 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a.c @@ -1,4 +1,5 @@ -int foo3() +int +foo3 (void) { return 21; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/a1.c b/ld64/unit-tests/test-cases/llvm-integration/a1.c index f9fb403c..52f5bde8 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a1.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a1.c @@ -2,7 +2,8 @@ #include #include extern int foo4(); -int foo3() +int +foo3 (void) { /* printf ("%s\n",strerror(errno)); */ return foo4(); diff --git a/ld64/unit-tests/test-cases/llvm-integration/a17.c b/ld64/unit-tests/test-cases/llvm-integration/a17.c index 1b8d4bf3..3931ec1e 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a17.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a17.c @@ -1,10 +1,12 @@ int a = 0; -int func_a() { return a; } +int +func_a (void) { return a; } // add code that will cause stack canary extern void fill(char*); -void test() +void +test (void) { char buf[100]; fill(buf); diff --git a/ld64/unit-tests/test-cases/llvm-integration/a2.c b/ld64/unit-tests/test-cases/llvm-integration/a2.c index 0eb20c5d..79ae2550 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a2.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a2.c @@ -1,5 +1,6 @@ extern int foo4(void); -int foo3() +int +foo3 (void) { return foo4(); } diff --git a/ld64/unit-tests/test-cases/llvm-integration/a20.c b/ld64/unit-tests/test-cases/llvm-integration/a20.c index cd529553..cabce9ef 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a20.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a20.c @@ -1,2 +1,4 @@ -void foo() {} -void bar() {} +void +foo (void) {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/llvm-integration/a3.c b/ld64/unit-tests/test-cases/llvm-integration/a3.c index 040ca5f9..daea45e0 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a3.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a3.c @@ -1,5 +1,6 @@ int bar; -int foo1() +int +foo1 (void) { return bar; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/a4.c b/ld64/unit-tests/test-cases/llvm-integration/a4.c index 0eb20c5d..79ae2550 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a4.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a4.c @@ -1,5 +1,6 @@ extern int foo4(void); -int foo3() +int +foo3 (void) { return foo4(); } diff --git a/ld64/unit-tests/test-cases/llvm-integration/a5.c b/ld64/unit-tests/test-cases/llvm-integration/a5.c index bcb22d90..c8ac1c63 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a5.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a5.c @@ -1,7 +1,8 @@ extern int foo2(void); extern int foo3(void); -int foo1() +int +foo1 (void) { int i = 42; if (foo2()) diff --git a/ld64/unit-tests/test-cases/llvm-integration/a6.c b/ld64/unit-tests/test-cases/llvm-integration/a6.c index b621453e..76f5f98a 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a6.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a6.c @@ -1,10 +1,12 @@ -int foo1() +int +foo1 (void) { return 42; } -int foo2() +int +foo2 (void) { return 21; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/a8.c b/ld64/unit-tests/test-cases/llvm-integration/a8.c index 47352a75..85b544ee 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a8.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a8.c @@ -9,7 +9,8 @@ void foo2(void) { } -static int foo3() { +static int +foo3 (void) { return 10; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/a9.c b/ld64/unit-tests/test-cases/llvm-integration/a9.c index da2c8faf..ee7c2b3b 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/a9.c +++ b/ld64/unit-tests/test-cases/llvm-integration/a9.c @@ -10,7 +10,8 @@ void foo2(void) { } -static int foo3() { +static int +foo3 (void) { foo4(); return 10; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/b.c b/ld64/unit-tests/test-cases/llvm-integration/b.c index 61c92dc1..06d3f8c5 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/b.c +++ b/ld64/unit-tests/test-cases/llvm-integration/b.c @@ -1,3 +1,4 @@ -int foo2() { +int +foo2 (void) { return 21; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/b1.c b/ld64/unit-tests/test-cases/llvm-integration/b1.c index 5158abe0..8312722c 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/b1.c +++ b/ld64/unit-tests/test-cases/llvm-integration/b1.c @@ -1,4 +1,5 @@ extern int foo4(); -int foo2() { +int +foo2 (void) { return foo4(); } diff --git a/ld64/unit-tests/test-cases/llvm-integration/b17.c b/ld64/unit-tests/test-cases/llvm-integration/b17.c index 47d4cc3c..f6829743 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/b17.c +++ b/ld64/unit-tests/test-cases/llvm-integration/b17.c @@ -1,4 +1,5 @@ int b = 0; -int func_b() { return b; } +int +func_b (void) { return b; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/b2.c b/ld64/unit-tests/test-cases/llvm-integration/b2.c index a20f6e3c..0d612fa1 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/b2.c +++ b/ld64/unit-tests/test-cases/llvm-integration/b2.c @@ -4,6 +4,7 @@ int foo4(void) { return 21; } -int foo2() { +int +foo2 (void) { return foo4(); } diff --git a/ld64/unit-tests/test-cases/llvm-integration/b20.c b/ld64/unit-tests/test-cases/llvm-integration/b20.c index f6c0ed3d..52691ff3 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/b20.c +++ b/ld64/unit-tests/test-cases/llvm-integration/b20.c @@ -1 +1,2 @@ -void frob() {} +void +frob (void) {} diff --git a/ld64/unit-tests/test-cases/llvm-integration/b3.c b/ld64/unit-tests/test-cases/llvm-integration/b3.c index 31e7ee83..1d23c6e7 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/b3.c +++ b/ld64/unit-tests/test-cases/llvm-integration/b3.c @@ -1,4 +1,5 @@ extern int bar; -int foo2() { +int +foo2 (void) { return bar; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/b4.c b/ld64/unit-tests/test-cases/llvm-integration/b4.c index 9437ad0f..f970a52d 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/b4.c +++ b/ld64/unit-tests/test-cases/llvm-integration/b4.c @@ -4,10 +4,12 @@ int foo4(void) { return 21; } -static int myfoo() +static int +myfoo (void) { return foo4(); } -int foo2() { +int +foo2 (void) { return myfoo(); } diff --git a/ld64/unit-tests/test-cases/llvm-integration/main.c b/ld64/unit-tests/test-cases/llvm-integration/main.c index ac424ca6..3be3aa3d 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main.c @@ -1,6 +1,7 @@ extern int foo2(); extern int foo3(); -int main(){ +int +main (void){ int i = foo3() + foo2(); if (i == 42) return 0; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main1.c b/ld64/unit-tests/test-cases/llvm-integration/main1.c index ccad10d3..7f0f73d3 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main1.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main1.c @@ -1,10 +1,12 @@ extern int foo2(); extern int foo3(); -int foo4() +int +foo4 (void) { return 21; } -int main(){ +int +main (void){ int i = foo3() + foo2(); if (i == 42) return 0; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main10.c b/ld64/unit-tests/test-cases/llvm-integration/main10.c index dabcdcf4..1050537a 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main10.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main10.c @@ -1,6 +1,7 @@ #include "b10.h" -int main() +int +main (void) { struct my_struct *mh = &my_hooks; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main11.c b/ld64/unit-tests/test-cases/llvm-integration/main11.c index 82ef7ffa..af9fdfc2 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main11.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main11.c @@ -1,6 +1,7 @@ extern void foo3(void); -int main() +int +main (void) { foo3(); return 0; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main12.c b/ld64/unit-tests/test-cases/llvm-integration/main12.c index 4de8725e..8e370e8a 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main12.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main12.c @@ -1,5 +1,6 @@ #include "a12.h" -int main() +int +main (void) { e[0] = ZERO; foo(); diff --git a/ld64/unit-tests/test-cases/llvm-integration/main16.c b/ld64/unit-tests/test-cases/llvm-integration/main16.c index 67112aa6..c68327a7 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main16.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main16.c @@ -2,7 +2,9 @@ int tent; int global = 5; -int foo() { return tent + global; } +int +foo (void) { return tent + global; } -int main() { foo(); return 0; } +int +main (void) { foo(); return 0; } diff --git a/ld64/unit-tests/test-cases/llvm-integration/main19.c b/ld64/unit-tests/test-cases/llvm-integration/main19.c index e09c1c9d..5a3bc5df 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main19.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main19.c @@ -1,6 +1,7 @@ extern int foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main2.c b/ld64/unit-tests/test-cases/llvm-integration/main2.c index ac424ca6..3be3aa3d 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main2.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main2.c @@ -1,6 +1,7 @@ extern int foo2(); extern int foo3(); -int main(){ +int +main (void){ int i = foo3() + foo2(); if (i == 42) return 0; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main20.c b/ld64/unit-tests/test-cases/llvm-integration/main20.c index 624e0093..df305ca4 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main20.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main20.c @@ -1,6 +1,7 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main3.c b/ld64/unit-tests/test-cases/llvm-integration/main3.c index a5058fe7..411e7ab0 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main3.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main3.c @@ -1,7 +1,8 @@ extern int foo1(); extern int foo2(); extern int bar; -int main(){ +int +main (void){ int i; bar = 14; i = foo1() + foo2() + bar; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main4.c b/ld64/unit-tests/test-cases/llvm-integration/main4.c index ac424ca6..3be3aa3d 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main4.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main4.c @@ -1,6 +1,7 @@ extern int foo2(); extern int foo3(); -int main(){ +int +main (void){ int i = foo3() + foo2(); if (i == 42) return 0; diff --git a/ld64/unit-tests/test-cases/llvm-integration/main5.c b/ld64/unit-tests/test-cases/llvm-integration/main5.c index 28d551d3..b41b7c14 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main5.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main5.c @@ -6,7 +6,8 @@ int foo3(void) return 42; } -int main() +int +main (void) { int i = foo1(); if (i == 42) diff --git a/ld64/unit-tests/test-cases/llvm-integration/main6.c b/ld64/unit-tests/test-cases/llvm-integration/main6.c index 3d003828..e7c297d4 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main6.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main6.c @@ -1,6 +1,7 @@ extern int foo1(); -int main() +int +main (void) { int i = foo1(); if (i == 42) diff --git a/ld64/unit-tests/test-cases/llvm-integration/main8.c b/ld64/unit-tests/test-cases/llvm-integration/main8.c index a9c924db..6636a522 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main8.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main8.c @@ -1,7 +1,8 @@ extern int foo1(void); extern void foo2(void); -int main() +int +main (void) { int i = foo1(); if (i == 42) diff --git a/ld64/unit-tests/test-cases/llvm-integration/main9.c b/ld64/unit-tests/test-cases/llvm-integration/main9.c index b44bf6e5..8585aa1e 100644 --- a/ld64/unit-tests/test-cases/llvm-integration/main9.c +++ b/ld64/unit-tests/test-cases/llvm-integration/main9.c @@ -4,7 +4,8 @@ extern void foo2(void); void foo4(void) { } -int main() +int +main (void) { int i = foo1(); if (i == 42) diff --git a/ld64/unit-tests/test-cases/loader_path/bar.c b/ld64/unit-tests/test-cases/loader_path/bar.c index a307157e..fcf198cc 100644 --- a/ld64/unit-tests/test-cases/loader_path/bar.c +++ b/ld64/unit-tests/test-cases/loader_path/bar.c @@ -1,5 +1,6 @@ -int bar() +int +bar (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/loader_path/foo.c b/ld64/unit-tests/test-cases/loader_path/foo.c index 8c2179db..09667187 100644 --- a/ld64/unit-tests/test-cases/loader_path/foo.c +++ b/ld64/unit-tests/test-cases/loader_path/foo.c @@ -1,7 +1,8 @@ extern int bar(); -int foo() +int +foo (void) { return bar(); } diff --git a/ld64/unit-tests/test-cases/loader_path/main.c b/ld64/unit-tests/test-cases/loader_path/main.c index 829ca5e4..f2cc2317 100644 --- a/ld64/unit-tests/test-cases/loader_path/main.c +++ b/ld64/unit-tests/test-cases/loader_path/main.c @@ -1,6 +1,7 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/local-symbol-partial-stripping/main.c b/ld64/unit-tests/test-cases/local-symbol-partial-stripping/main.c index 013bc55e..bedaee8d 100644 --- a/ld64/unit-tests/test-cases/local-symbol-partial-stripping/main.c +++ b/ld64/unit-tests/test-cases/local-symbol-partial-stripping/main.c @@ -3,7 +3,8 @@ extern int myglobal; extern void myfunction(int); -int main() +int +main (void) { myfunction(myglobal); return 0; diff --git a/ld64/unit-tests/test-cases/lto-archive-dylib/foo.c b/ld64/unit-tests/test-cases/lto-archive-dylib/foo.c index 1592c764..64dc9638 100644 --- a/ld64/unit-tests/test-cases/lto-archive-dylib/foo.c +++ b/ld64/unit-tests/test-cases/lto-archive-dylib/foo.c @@ -1,5 +1,6 @@ #include -void foo() +void +foo (void) { fprintf(stderr, "hello\n"); } diff --git a/ld64/unit-tests/test-cases/lto-archive-dylib/main.c b/ld64/unit-tests/test-cases/lto-archive-dylib/main.c index ae2f9560..58f6a580 100644 --- a/ld64/unit-tests/test-cases/lto-archive-dylib/main.c +++ b/ld64/unit-tests/test-cases/lto-archive-dylib/main.c @@ -1,6 +1,7 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/lto-archive-objc/main.c b/ld64/unit-tests/test-cases/lto-archive-objc/main.c index b2ccbdce..856acc8a 100644 --- a/ld64/unit-tests/test-cases/lto-archive-objc/main.c +++ b/ld64/unit-tests/test-cases/lto-archive-objc/main.c @@ -1,5 +1,6 @@ -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-all-hidden/bar.c b/ld64/unit-tests/test-cases/lto-dead_strip-all-hidden/bar.c index b3e39589..3d0acbc1 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-all-hidden/bar.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-all-hidden/bar.c @@ -1,4 +1,5 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/foo.c b/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/foo.c index f47f84d1..bea3725a 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/foo.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/foo.c @@ -2,19 +2,22 @@ #include #include -void foo1() +void +foo1 (void) { CFStringGetLength(CFSTR("test1")); strlen("str1"); } -void foo2() +void +foo2 (void) { CFStringGetLength(CFSTR("test2")); strlen("str2"); } -void foo3() +void +foo3 (void) { CFStringGetLength(CFSTR("test3")); strlen("str3"); diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/main.c b/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/main.c index 08e2cd2c..8bfcf901 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/main.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-coalesce/main.c @@ -7,30 +7,35 @@ extern void foo1(); extern void foo2(); -void t1() +void +t1 (void) { CFStringGetLength(CFSTR("test1")); strlen("str1"); } -void t2() +void +t2 (void) { CFStringGetLength(CFSTR("test2")); strlen("str2"); } -void t3() +void +t3 (void) { CFStringGetLength(CFSTR("test3")); strlen("str3"); } // error with LTO and dead strip of non-lazy-pointer -void* foo2p() { +void * +foo2p (void) { return &foo2; } -int main() +int +main (void) { t2(); foo1(); diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/bar.c b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/bar.c index d8fb5263..248d0fe2 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/bar.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/bar.c @@ -1,4 +1,5 @@ int tent; -int bar() { return tent; } +int +bar (void) { return tent; } diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/baz.c b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/baz.c index d1cca6e9..86f7b372 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/baz.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/baz.c @@ -1,5 +1,6 @@ int tent; -int baz() { return tent; } +int +baz (void) { return tent; } diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/foo.c b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/foo.c index 983fe9c8..a5f7607e 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/foo.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/foo.c @@ -1,4 +1,5 @@ int tent; -int foo() { return tent; } +int +foo (void) { return tent; } diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/main.c b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/main.c index 4138be7d..439136b4 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-tentative/main.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-tentative/main.c @@ -3,7 +3,8 @@ extern int foo(); extern int bar(); extern int baz(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-unused/bar.c b/ld64/unit-tests/test-cases/lto-dead_strip-unused/bar.c index f5f58234..bc38b845 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-unused/bar.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-unused/bar.c @@ -1,13 +1,15 @@ -void bar() +void +bar (void) { } extern void unused1(); -void unused2() +void +unused2 (void) { unused1(); } diff --git a/ld64/unit-tests/test-cases/lto-dead_strip-unused/main.c b/ld64/unit-tests/test-cases/lto-dead_strip-unused/main.c index f04d4754..c0e18697 100644 --- a/ld64/unit-tests/test-cases/lto-dead_strip-unused/main.c +++ b/ld64/unit-tests/test-cases/lto-dead_strip-unused/main.c @@ -1,6 +1,7 @@ extern void bar(); -int main() +int +main (void) { bar(); return 0; diff --git a/ld64/unit-tests/test-cases/lto-duplicate_symbols/static.c b/ld64/unit-tests/test-cases/lto-duplicate_symbols/static.c index d40d247f..3e535ed7 100644 --- a/ld64/unit-tests/test-cases/lto-duplicate_symbols/static.c +++ b/ld64/unit-tests/test-cases/lto-duplicate_symbols/static.c @@ -3,7 +3,8 @@ static int same_name(int i) return i + 10; } -int other() +int +other (void) { return same_name(100); } diff --git a/ld64/unit-tests/test-cases/lto-dylib-aliases/foo.c b/ld64/unit-tests/test-cases/lto-dylib-aliases/foo.c index 2114ee8a..6e76ecf1 100644 --- a/ld64/unit-tests/test-cases/lto-dylib-aliases/foo.c +++ b/ld64/unit-tests/test-cases/lto-dylib-aliases/foo.c @@ -1,7 +1,8 @@ #include -void foo() { +void +foo (void) { printf("hello\n"); } diff --git a/ld64/unit-tests/test-cases/lto-llvm-options/main.c b/ld64/unit-tests/test-cases/lto-llvm-options/main.c index 578d24bc..c3f85cd5 100644 --- a/ld64/unit-tests/test-cases/lto-llvm-options/main.c +++ b/ld64/unit-tests/test-cases/lto-llvm-options/main.c @@ -7,7 +7,8 @@ void foo(int x) printf("hello, world %d\n", x); } -int main() +int +main (void) { foo(10); return 0; diff --git a/ld64/unit-tests/test-cases/lto-objc-archive/bar2.c b/ld64/unit-tests/test-cases/lto-objc-archive/bar2.c index 1422109a..6437916d 100644 --- a/ld64/unit-tests/test-cases/lto-objc-archive/bar2.c +++ b/ld64/unit-tests/test-cases/lto-objc-archive/bar2.c @@ -1,2 +1,3 @@ -void bar2() {} +void +bar2 (void) {} diff --git a/ld64/unit-tests/test-cases/lto-objc-archive/foo2.c b/ld64/unit-tests/test-cases/lto-objc-archive/foo2.c index 9d2ab140..b90ba961 100644 --- a/ld64/unit-tests/test-cases/lto-objc-archive/foo2.c +++ b/ld64/unit-tests/test-cases/lto-objc-archive/foo2.c @@ -1,2 +1,3 @@ -void foo2() {} +void +foo2 (void) {} diff --git a/ld64/unit-tests/test-cases/lto-object_path/main.c b/ld64/unit-tests/test-cases/lto-object_path/main.c index 578d24bc..c3f85cd5 100644 --- a/ld64/unit-tests/test-cases/lto-object_path/main.c +++ b/ld64/unit-tests/test-cases/lto-object_path/main.c @@ -7,7 +7,8 @@ void foo(int x) printf("hello, world %d\n", x); } -int main() +int +main (void) { foo(10); return 0; diff --git a/ld64/unit-tests/test-cases/lto-r/bar.c b/ld64/unit-tests/test-cases/lto-r/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/lto-r/bar.c +++ b/ld64/unit-tests/test-cases/lto-r/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/lto-r/main.c b/ld64/unit-tests/test-cases/lto-r/main.c index 578d24bc..c3f85cd5 100644 --- a/ld64/unit-tests/test-cases/lto-r/main.c +++ b/ld64/unit-tests/test-cases/lto-r/main.c @@ -7,7 +7,8 @@ void foo(int x) printf("hello, world %d\n", x); } -int main() +int +main (void) { foo(10); return 0; diff --git a/ld64/unit-tests/test-cases/lto-symbol-section-move/foo.c b/ld64/unit-tests/test-cases/lto-symbol-section-move/foo.c index 93605852..54352d98 100644 --- a/ld64/unit-tests/test-cases/lto-symbol-section-move/foo.c +++ b/ld64/unit-tests/test-cases/lto-symbol-section-move/foo.c @@ -7,9 +7,11 @@ extern int def; extern int ghi; extern int com; -double getpi() { return 3.1415926535; } +double +getpi (void) { return 3.1415926535; } -void bar() +void +bar (void) { } @@ -31,7 +33,8 @@ void* all[] = { &main, &version, &mainget, &getpi, &otherget, &bar, &foo, &x, &abc, &def, &ghi, &com, &com3, &com4, &com5 }; -void* foo() +void * +foo (void) { return all; } diff --git a/ld64/unit-tests/test-cases/lto-symbol-section-move/main.c b/ld64/unit-tests/test-cases/lto-symbol-section-move/main.c index ce97d92a..7484291f 100644 --- a/ld64/unit-tests/test-cases/lto-symbol-section-move/main.c +++ b/ld64/unit-tests/test-cases/lto-symbol-section-move/main.c @@ -1,32 +1,39 @@ extern void* otherget(); -void mm() +void +mm (void) { } -static void s1() { +static void +s1 (void) { mm(); } -static void s2() { +static void +s2 (void) { mm(); } -int main() +int +main (void) { s1(); s2(); return 0; } -const char* version() { return "1.0"; } +const char * +version (void) { return "1.0"; } -static int mylocal() +static int +mylocal (void) { return 0; } -void* mainget() { return mylocal; } +void * +mainget (void) { return mylocal; } int def = 20; diff --git a/ld64/unit-tests/test-cases/lto-symbol-section-move/other.c b/ld64/unit-tests/test-cases/lto-symbol-section-move/other.c index 37d5047f..8f88c200 100644 --- a/ld64/unit-tests/test-cases/lto-symbol-section-move/other.c +++ b/ld64/unit-tests/test-cases/lto-symbol-section-move/other.c @@ -1,9 +1,11 @@ -static int mylocal() +static int +mylocal (void) { return 1; } -void* otherget() { return mylocal; } +void * +otherget (void) { return mylocal; } diff --git a/ld64/unit-tests/test-cases/lto-unexport-sym/a.c b/ld64/unit-tests/test-cases/lto-unexport-sym/a.c index 89cea52f..5b5b6c88 100644 --- a/ld64/unit-tests/test-cases/lto-unexport-sym/a.c +++ b/ld64/unit-tests/test-cases/lto-unexport-sym/a.c @@ -1,7 +1,9 @@ void foo(); -void bar() { +void +bar (void) { foo(); } -int main() { +int +main (void) { } diff --git a/ld64/unit-tests/test-cases/lto-unexport-sym/b.c b/ld64/unit-tests/test-cases/lto-unexport-sym/b.c index d0d3aa5a..3916b800 100644 --- a/ld64/unit-tests/test-cases/lto-unexport-sym/b.c +++ b/ld64/unit-tests/test-cases/lto-unexport-sym/b.c @@ -1,3 +1,4 @@ -void foo() { +void +foo (void) { } \ No newline at end of file diff --git a/ld64/unit-tests/test-cases/lto-weak-native-override/foo.c b/ld64/unit-tests/test-cases/lto-weak-native-override/foo.c index f65d830a..194936ca 100644 --- a/ld64/unit-tests/test-cases/lto-weak-native-override/foo.c +++ b/ld64/unit-tests/test-cases/lto-weak-native-override/foo.c @@ -1,6 +1,7 @@ -void foo() +void +foo (void) { // do nothing } diff --git a/ld64/unit-tests/test-cases/lto-weak_import/foo.c b/ld64/unit-tests/test-cases/lto-weak_import/foo.c index b5866751..29135fb4 100644 --- a/ld64/unit-tests/test-cases/lto-weak_import/foo.c +++ b/ld64/unit-tests/test-cases/lto-weak_import/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/main-stripped/main.c b/ld64/unit-tests/test-cases/main-stripped/main.c index 13046158..068b7f1e 100644 --- a/ld64/unit-tests/test-cases/main-stripped/main.c +++ b/ld64/unit-tests/test-cases/main-stripped/main.c @@ -31,7 +31,8 @@ asm(".desc _magicSymbol, 0x10"); int hiddenSymbol = 1; asm(".desc _hiddenSymbol, 0x10"); -int main() +int +main (void) { return 0; } \ No newline at end of file diff --git a/ld64/unit-tests/test-cases/merge_zero_fill_sections/main.c b/ld64/unit-tests/test-cases/merge_zero_fill_sections/main.c index 87528ec6..7196a3dc 100755 --- a/ld64/unit-tests/test-cases/merge_zero_fill_sections/main.c +++ b/ld64/unit-tests/test-cases/merge_zero_fill_sections/main.c @@ -32,7 +32,8 @@ extern void* zerofill__end __asm("section$end$__DATA$__zerofill"); void* start = &zerofill_start; void* end = &zerofill__end; -int main() +int +main (void) { a[0] = 0; b[0] = 0; diff --git a/ld64/unit-tests/test-cases/no-data-bundle/foo.c b/ld64/unit-tests/test-cases/no-data-bundle/foo.c index 5cb3e317..419d684d 100644 --- a/ld64/unit-tests/test-cases/no-data-bundle/foo.c +++ b/ld64/unit-tests/test-cases/no-data-bundle/foo.c @@ -1,6 +1,7 @@ #include -void foo() +void +foo (void) { rand(); } \ No newline at end of file diff --git a/ld64/unit-tests/test-cases/no_zero_fill_sections/main.c b/ld64/unit-tests/test-cases/no_zero_fill_sections/main.c index a04a2ca6..8b41d6de 100755 --- a/ld64/unit-tests/test-cases/no_zero_fill_sections/main.c +++ b/ld64/unit-tests/test-cases/no_zero_fill_sections/main.c @@ -26,7 +26,8 @@ static int a[2000]; int b[2000]; -int main() +int +main (void) { a[0] = 0; b[0] = 0; diff --git a/ld64/unit-tests/test-cases/non-lazy-r/foo.c b/ld64/unit-tests/test-cases/non-lazy-r/foo.c index bfde3ded..4393f881 100644 --- a/ld64/unit-tests/test-cases/non-lazy-r/foo.c +++ b/ld64/unit-tests/test-cases/non-lazy-r/foo.c @@ -3,18 +3,22 @@ extern int foo; -int getfoo() { return foo; } +int +getfoo (void) { return foo; } extern int other; -int getother() { return other; } +int +getother (void) { return other; } extern int tent; -int gettent() { return tent; } +int +gettent (void) { return tent; } extern void* func; -void* getfunc() { return func; } +void * +getfunc (void) { return func; } diff --git a/ld64/unit-tests/test-cases/non-lazy-r/other.c b/ld64/unit-tests/test-cases/non-lazy-r/other.c index 8ee4784a..a48f908a 100644 --- a/ld64/unit-tests/test-cases/non-lazy-r/other.c +++ b/ld64/unit-tests/test-cases/non-lazy-r/other.c @@ -1,4 +1,5 @@ int foo = 2; int other = 3; int tent; -void func() {} +void +func (void) {} diff --git a/ld64/unit-tests/test-cases/objc-gc-checks/none.c b/ld64/unit-tests/test-cases/objc-gc-checks/none.c index 44506faa..4f48f200 100644 --- a/ld64/unit-tests/test-cases/objc-gc-checks/none.c +++ b/ld64/unit-tests/test-cases/objc-gc-checks/none.c @@ -1 +1,2 @@ -void none() {} +void +none (void) {} diff --git a/ld64/unit-tests/test-cases/objc-gc-checks/runtime.c b/ld64/unit-tests/test-cases/objc-gc-checks/runtime.c index df4aeefa..14427f7a 100644 --- a/ld64/unit-tests/test-cases/objc-gc-checks/runtime.c +++ b/ld64/unit-tests/test-cases/objc-gc-checks/runtime.c @@ -1,2 +1,4 @@ -void _objc_empty_cache() {} -void _objc_empty_vtable() {} +void +_objc_empty_cache (void) {} +void +_objc_empty_vtable (void) {} diff --git a/ld64/unit-tests/test-cases/order_file-archive/foo.c b/ld64/unit-tests/test-cases/order_file-archive/foo.c index 61be9769..d8d5cbe7 100644 --- a/ld64/unit-tests/test-cases/order_file-archive/foo.c +++ b/ld64/unit-tests/test-cases/order_file-archive/foo.c @@ -1,4 +1,7 @@ -void foo1() { } -void foo2() {} -void foo3() {} +void +foo1 (void) { } +void +foo2 (void) {} +void +foo3 (void) {} diff --git a/ld64/unit-tests/test-cases/order_file-archive/main.c b/ld64/unit-tests/test-cases/order_file-archive/main.c index 298aedc9..56fc7468 100644 --- a/ld64/unit-tests/test-cases/order_file-archive/main.c +++ b/ld64/unit-tests/test-cases/order_file-archive/main.c @@ -26,7 +26,8 @@ extern void foo1(); -int main() +int +main (void) { foo1(); return 0; diff --git a/ld64/unit-tests/test-cases/order_file-zero-fill/main.c b/ld64/unit-tests/test-cases/order_file-zero-fill/main.c index 6c37d8e1..a1f34360 100644 --- a/ld64/unit-tests/test-cases/order_file-zero-fill/main.c +++ b/ld64/unit-tests/test-cases/order_file-zero-fill/main.c @@ -31,7 +31,8 @@ int xyz_mi4 = 4; int main_common; -int main() +int +main (void) { fprintf(stdout, "hello %p\n", &xyz_ms1); return 0; diff --git a/ld64/unit-tests/test-cases/order_file/main.c b/ld64/unit-tests/test-cases/order_file/main.c index 5643b459..77f8f93b 100644 --- a/ld64/unit-tests/test-cases/order_file/main.c +++ b/ld64/unit-tests/test-cases/order_file/main.c @@ -23,11 +23,15 @@ */ #include -int main() +int +main (void) { return 0; } -void main2() {} -void main3() {} -void main4() {} +void +main2 (void) {} +void +main3 (void) {} +void +main4 (void) {} diff --git a/ld64/unit-tests/test-cases/pipelined-linking/bar.c b/ld64/unit-tests/test-cases/pipelined-linking/bar.c index 320c2464..85c895e6 100644 --- a/ld64/unit-tests/test-cases/pipelined-linking/bar.c +++ b/ld64/unit-tests/test-cases/pipelined-linking/bar.c @@ -1,4 +1,5 @@ -void bar() +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/pipelined-linking/cat.c b/ld64/unit-tests/test-cases/pipelined-linking/cat.c index 0e321663..1af166c1 100644 --- a/ld64/unit-tests/test-cases/pipelined-linking/cat.c +++ b/ld64/unit-tests/test-cases/pipelined-linking/cat.c @@ -1,4 +1,5 @@ -void cat() +void +cat (void) { } diff --git a/ld64/unit-tests/test-cases/pipelined-linking/foo.c b/ld64/unit-tests/test-cases/pipelined-linking/foo.c index 6e0d3208..49187cbe 100644 --- a/ld64/unit-tests/test-cases/pipelined-linking/foo.c +++ b/ld64/unit-tests/test-cases/pipelined-linking/foo.c @@ -1,9 +1,11 @@ -void foo() +void +foo (void) { } -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/prebound-split-seg/bar.c b/ld64/unit-tests/test-cases/prebound-split-seg/bar.c index 46b7269b..57853f46 100644 --- a/ld64/unit-tests/test-cases/prebound-split-seg/bar.c +++ b/ld64/unit-tests/test-cases/prebound-split-seg/bar.c @@ -27,7 +27,8 @@ int x = 3; int* xp = &x; -int bar() +int +bar (void) { return *xp; } diff --git a/ld64/unit-tests/test-cases/preload-section_order/main.c b/ld64/unit-tests/test-cases/preload-section_order/main.c index a9a516f6..51cca17e 100644 --- a/ld64/unit-tests/test-cases/preload-section_order/main.c +++ b/ld64/unit-tests/test-cases/preload-section_order/main.c @@ -1,5 +1,6 @@ -void entry() { +void +entry (void) { } diff --git a/ld64/unit-tests/test-cases/preload-segment_order/a.c b/ld64/unit-tests/test-cases/preload-segment_order/a.c index b07e94c3..da12fc4e 100644 --- a/ld64/unit-tests/test-cases/preload-segment_order/a.c +++ b/ld64/unit-tests/test-cases/preload-segment_order/a.c @@ -5,7 +5,8 @@ const char** myp = &mystring; int com; -const char* inc() { +const char * +inc (void) { ++com; return ""; } diff --git a/ld64/unit-tests/test-cases/preload-segment_order/b.c b/ld64/unit-tests/test-cases/preload-segment_order/b.c index 89db6f13..d73c1743 100644 --- a/ld64/unit-tests/test-cases/preload-segment_order/b.c +++ b/ld64/unit-tests/test-cases/preload-segment_order/b.c @@ -2,7 +2,8 @@ const char* mystring = "hello"; int var = 10; -const char* incget() { +const char * +incget (void) { ++var; return mystring; } diff --git a/ld64/unit-tests/test-cases/private-non-lazy/foo.c b/ld64/unit-tests/test-cases/private-non-lazy/foo.c index 6816d0bd..3e5c9473 100644 --- a/ld64/unit-tests/test-cases/private-non-lazy/foo.c +++ b/ld64/unit-tests/test-cases/private-non-lazy/foo.c @@ -2,6 +2,7 @@ extern int foo; -int getfoo() { return foo; } +int +getfoo (void) { return foo; } diff --git a/ld64/unit-tests/test-cases/private-non-lazy/hello.c b/ld64/unit-tests/test-cases/private-non-lazy/hello.c index 20dccc4e..24753f11 100644 --- a/ld64/unit-tests/test-cases/private-non-lazy/hello.c +++ b/ld64/unit-tests/test-cases/private-non-lazy/hello.c @@ -25,7 +25,8 @@ extern int getfoo(); -int main() +int +main (void) { return getfoo(); } diff --git a/ld64/unit-tests/test-cases/re-export-and-use/bar.c b/ld64/unit-tests/test-cases/re-export-and-use/bar.c index 642a280a..8c3f243b 100644 --- a/ld64/unit-tests/test-cases/re-export-and-use/bar.c +++ b/ld64/unit-tests/test-cases/re-export-and-use/bar.c @@ -1,5 +1,6 @@ -int bar() +int +bar (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/re-export-and-use/baz.c b/ld64/unit-tests/test-cases/re-export-and-use/baz.c index 98b78326..b76aa3a8 100644 --- a/ld64/unit-tests/test-cases/re-export-and-use/baz.c +++ b/ld64/unit-tests/test-cases/re-export-and-use/baz.c @@ -1,5 +1,6 @@ -int baz() +int +baz (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/re-export-and-use/foo.c b/ld64/unit-tests/test-cases/re-export-and-use/foo.c index ad634d39..b2a3b8d3 100644 --- a/ld64/unit-tests/test-cases/re-export-and-use/foo.c +++ b/ld64/unit-tests/test-cases/re-export-and-use/foo.c @@ -7,7 +7,8 @@ void* pbar = &bar; void* pbaz = &baz; #endif -int foo() +int +foo (void) { #if USE_BAZ baz(); diff --git a/ld64/unit-tests/test-cases/re-export-and-use/pub.c b/ld64/unit-tests/test-cases/re-export-and-use/pub.c index 03ffc1b2..6bb2715d 100644 --- a/ld64/unit-tests/test-cases/re-export-and-use/pub.c +++ b/ld64/unit-tests/test-cases/re-export-and-use/pub.c @@ -1,5 +1,6 @@ -int pub() +int +pub (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/re-export-layers/main.c b/ld64/unit-tests/test-cases/re-export-layers/main.c index 5f1fae96..d2b00b15 100644 --- a/ld64/unit-tests/test-cases/re-export-layers/main.c +++ b/ld64/unit-tests/test-cases/re-export-layers/main.c @@ -5,7 +5,8 @@ extern void bar(); extern void foo(); -int main() +int +main (void) { baz(); bar(); diff --git a/ld64/unit-tests/test-cases/re-export-optimizations-indirect/main.c b/ld64/unit-tests/test-cases/re-export-optimizations-indirect/main.c index 672ef9a8..b4d7fa3f 100644 --- a/ld64/unit-tests/test-cases/re-export-optimizations-indirect/main.c +++ b/ld64/unit-tests/test-cases/re-export-optimizations-indirect/main.c @@ -1,7 +1,8 @@ extern void bar(); -int main() +int +main (void) { bar(); return 0; diff --git a/ld64/unit-tests/test-cases/re-export-optimizations-indirect/middle.c b/ld64/unit-tests/test-cases/re-export-optimizations-indirect/middle.c index d3578a61..69182407 100644 --- a/ld64/unit-tests/test-cases/re-export-optimizations-indirect/middle.c +++ b/ld64/unit-tests/test-cases/re-export-optimizations-indirect/middle.c @@ -1,3 +1,4 @@ -void middle() {} +void +middle (void) {} diff --git a/ld64/unit-tests/test-cases/re-export-optimizations-indirect/other.c b/ld64/unit-tests/test-cases/re-export-optimizations-indirect/other.c index 0cd6dda0..077d0ed0 100644 --- a/ld64/unit-tests/test-cases/re-export-optimizations-indirect/other.c +++ b/ld64/unit-tests/test-cases/re-export-optimizations-indirect/other.c @@ -1 +1,2 @@ -void other() {} +void +other (void) {} diff --git a/ld64/unit-tests/test-cases/re-export-optimizations/main.c b/ld64/unit-tests/test-cases/re-export-optimizations/main.c index 2b85b0e1..b772bfab 100644 --- a/ld64/unit-tests/test-cases/re-export-optimizations/main.c +++ b/ld64/unit-tests/test-cases/re-export-optimizations/main.c @@ -1,7 +1,8 @@ extern void bar(); -int main() +int +main (void) { #if CALL_BAR bar(); diff --git a/ld64/unit-tests/test-cases/re-export-relative-paths/main.c b/ld64/unit-tests/test-cases/re-export-relative-paths/main.c index 367c6cb1..070a6388 100644 --- a/ld64/unit-tests/test-cases/re-export-relative-paths/main.c +++ b/ld64/unit-tests/test-cases/re-export-relative-paths/main.c @@ -2,7 +2,8 @@ extern int foo(); extern int bar(); extern int wrap(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/re-export-relative-paths/wrap.c b/ld64/unit-tests/test-cases/re-export-relative-paths/wrap.c index d3cdd85c..191b1fc8 100644 --- a/ld64/unit-tests/test-cases/re-export-relative-paths/wrap.c +++ b/ld64/unit-tests/test-cases/re-export-relative-paths/wrap.c @@ -1,2 +1,3 @@ -int wrap() { return 0; } +int +wrap (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/re-export-symbol/main1.c b/ld64/unit-tests/test-cases/re-export-symbol/main1.c index 7bb5c6bd..a6cf7f92 100644 --- a/ld64/unit-tests/test-cases/re-export-symbol/main1.c +++ b/ld64/unit-tests/test-cases/re-export-symbol/main1.c @@ -2,7 +2,8 @@ extern int foo(); extern int bar(); extern int bar_weak(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/re-export-symbol/main2.c b/ld64/unit-tests/test-cases/re-export-symbol/main2.c index edac057a..26039c51 100644 --- a/ld64/unit-tests/test-cases/re-export-symbol/main2.c +++ b/ld64/unit-tests/test-cases/re-export-symbol/main2.c @@ -1,7 +1,8 @@ extern int foo(); extern int mybar(); -int main() +int +main (void) { foo(); mybar(); diff --git a/ld64/unit-tests/test-cases/read-only-relocs/foo.c b/ld64/unit-tests/test-cases/read-only-relocs/foo.c index bef15803..2252cffc 100644 --- a/ld64/unit-tests/test-cases/read-only-relocs/foo.c +++ b/ld64/unit-tests/test-cases/read-only-relocs/foo.c @@ -1,6 +1,7 @@ int b=0; -void func() {} +void +func (void) {} diff --git a/ld64/unit-tests/test-cases/read-only-relocs/main.c b/ld64/unit-tests/test-cases/read-only-relocs/main.c index d5fe9c21..1c5507d0 100644 --- a/ld64/unit-tests/test-cases/read-only-relocs/main.c +++ b/ld64/unit-tests/test-cases/read-only-relocs/main.c @@ -2,7 +2,8 @@ extern int b; extern void func(); -int main() +int +main (void) { func(); return b; diff --git a/ld64/unit-tests/test-cases/read-only-relocs/test.c b/ld64/unit-tests/test-cases/read-only-relocs/test.c index f3484e27..f9644593 100644 --- a/ld64/unit-tests/test-cases/read-only-relocs/test.c +++ b/ld64/unit-tests/test-cases/read-only-relocs/test.c @@ -26,7 +26,8 @@ int a=0; extern int b; extern void func(); -int main() +int +main (void) { func(); return a+b; diff --git a/ld64/unit-tests/test-cases/read-only-relocs/test_bind.c b/ld64/unit-tests/test-cases/read-only-relocs/test_bind.c index 8ec6b8d7..930c37b5 100644 --- a/ld64/unit-tests/test-cases/read-only-relocs/test_bind.c +++ b/ld64/unit-tests/test-cases/read-only-relocs/test_bind.c @@ -2,7 +2,8 @@ extern int b; extern void func(); -int test_bind() +int +test_bind (void) { func(); return b; diff --git a/ld64/unit-tests/test-cases/read-only-relocs/test_rebase.c b/ld64/unit-tests/test-cases/read-only-relocs/test_rebase.c index 1ddf43c7..4afeec19 100644 --- a/ld64/unit-tests/test-cases/read-only-relocs/test_rebase.c +++ b/ld64/unit-tests/test-cases/read-only-relocs/test_rebase.c @@ -1,7 +1,8 @@ int a=0; -int test_rebase() +int +test_rebase (void) { return a; } diff --git a/ld64/unit-tests/test-cases/rebase-basic/foo.c b/ld64/unit-tests/test-cases/rebase-basic/foo.c index 15d4ae65..ddcb9182 100644 --- a/ld64/unit-tests/test-cases/rebase-basic/foo.c +++ b/ld64/unit-tests/test-cases/rebase-basic/foo.c @@ -1,5 +1,6 @@ -int foo() { return 10; } +int +foo (void) { return 10; } void* foop = &foo; diff --git a/ld64/unit-tests/test-cases/reexport_symbols_list/main1.c b/ld64/unit-tests/test-cases/reexport_symbols_list/main1.c index 4655cb62..2e157a29 100644 --- a/ld64/unit-tests/test-cases/reexport_symbols_list/main1.c +++ b/ld64/unit-tests/test-cases/reexport_symbols_list/main1.c @@ -1,7 +1,8 @@ extern int foo(); extern int bart(); -int main() +int +main (void) { foo(); bart(); diff --git a/ld64/unit-tests/test-cases/relocs-literals/test.c b/ld64/unit-tests/test-cases/relocs-literals/test.c index 5939ef42..14fce1c4 100644 --- a/ld64/unit-tests/test-cases/relocs-literals/test.c +++ b/ld64/unit-tests/test-cases/relocs-literals/test.c @@ -29,10 +29,14 @@ const char charArray1[] = "charArray1"; static const char charArray2[] = "charArray2"; -const char* getString() { return "string"; } -const char* getString2() { return charArray2; } -const char* getString3() { return charArray1; } -const char* getString4() { return foo; } +const char * +getString (void) { return "string"; } +const char * +getString2 (void) { return charArray2; } +const char * +getString3 (void) { return charArray1; } +const char * +getString4 (void) { return foo; } float f1 = 3.0; @@ -41,9 +45,12 @@ long double ld1 = 3.0; -float getSingle() { return 1.0; } -double getDouble() { return 2.0; } -long double getLongDouble() { return 3.0; } +float +getSingle (void) { return 1.0; } +double +getDouble (void) { return 2.0; } +long double +getLongDouble (void) { return 3.0; } // rdar://problem/4732996 diff --git a/ld64/unit-tests/test-cases/relocs-literals2/test.c b/ld64/unit-tests/test-cases/relocs-literals2/test.c index 5939ef42..14fce1c4 100644 --- a/ld64/unit-tests/test-cases/relocs-literals2/test.c +++ b/ld64/unit-tests/test-cases/relocs-literals2/test.c @@ -29,10 +29,14 @@ const char charArray1[] = "charArray1"; static const char charArray2[] = "charArray2"; -const char* getString() { return "string"; } -const char* getString2() { return charArray2; } -const char* getString3() { return charArray1; } -const char* getString4() { return foo; } +const char * +getString (void) { return "string"; } +const char * +getString2 (void) { return charArray2; } +const char * +getString3 (void) { return charArray1; } +const char * +getString4 (void) { return foo; } float f1 = 3.0; @@ -41,9 +45,12 @@ long double ld1 = 3.0; -float getSingle() { return 1.0; } -double getDouble() { return 2.0; } -long double getLongDouble() { return 3.0; } +float +getSingle (void) { return 1.0; } +double +getDouble (void) { return 2.0; } +long double +getLongDouble (void) { return 3.0; } // rdar://problem/4732996 diff --git a/ld64/unit-tests/test-cases/relocs-literals3/test.c b/ld64/unit-tests/test-cases/relocs-literals3/test.c index 31e87c22..2ef74f61 100644 --- a/ld64/unit-tests/test-cases/relocs-literals3/test.c +++ b/ld64/unit-tests/test-cases/relocs-literals3/test.c @@ -29,10 +29,14 @@ const char charArray1[] = "charArray1"; static const char charArray2[] = "charArray2"; -const char* getString() { return "string"; } -const char* getString2() { return charArray2; } -const char* getString3() { return charArray1; } -const char* getString4() { return foo; } +const char * +getString (void) { return "string"; } +const char * +getString2 (void) { return charArray2; } +const char * +getString3 (void) { return charArray1; } +const char * +getString4 (void) { return foo; } float f1 = 3.0; @@ -41,7 +45,10 @@ long double ld1 = 3.0; -float getSingle() { return 1.0; } -double getDouble() { return 2.0; } -long double getLongDouble() { return 3.0; } +float +getSingle (void) { return 1.0; } +double +getDouble (void) { return 2.0; } +long double +getLongDouble (void) { return 3.0; } diff --git a/ld64/unit-tests/test-cases/sectcreate-dead_strip/main.c b/ld64/unit-tests/test-cases/sectcreate-dead_strip/main.c index fc047f75..0c53d8d2 100644 --- a/ld64/unit-tests/test-cases/sectcreate-dead_strip/main.c +++ b/ld64/unit-tests/test-cases/sectcreate-dead_strip/main.c @@ -1,5 +1,6 @@ -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/section-labels-zero-fill/both.c b/ld64/unit-tests/test-cases/section-labels-zero-fill/both.c index fc1eabc3..960b85fd 100644 --- a/ld64/unit-tests/test-cases/section-labels-zero-fill/both.c +++ b/ld64/unit-tests/test-cases/section-labels-zero-fill/both.c @@ -32,7 +32,8 @@ extern int common_end __asm("section$end$__DATA$__common"); int mycommon[2]; static int mybss[2]; -int main() +int +main (void) { mybss[0] = 0; printf("bss start = %p\n", &bss_start); diff --git a/ld64/unit-tests/test-cases/section-labels-zero-fill/bss.c b/ld64/unit-tests/test-cases/section-labels-zero-fill/bss.c index d9b580b0..b0990f09 100644 --- a/ld64/unit-tests/test-cases/section-labels-zero-fill/bss.c +++ b/ld64/unit-tests/test-cases/section-labels-zero-fill/bss.c @@ -29,7 +29,8 @@ extern int bss_end __asm("section$end$__DATA$__bss"); static int mybss[2]; -int main() +int +main (void) { mybss[0] = 0; printf("bss start = %p\n", &bss_start); diff --git a/ld64/unit-tests/test-cases/section-labels-zero-fill/common.c b/ld64/unit-tests/test-cases/section-labels-zero-fill/common.c index 57a1270b..c8becd76 100644 --- a/ld64/unit-tests/test-cases/section-labels-zero-fill/common.c +++ b/ld64/unit-tests/test-cases/section-labels-zero-fill/common.c @@ -29,7 +29,8 @@ extern int common_end __asm("section$end$__DATA$__common"); int mycommon[2]; -int main() +int +main (void) { printf("common start = %p\n", &common_start); printf("common end = %p\n", &common_end); diff --git a/ld64/unit-tests/test-cases/section-names-long/main.c b/ld64/unit-tests/test-cases/section-names-long/main.c index df774481..3952f8dd 100644 --- a/ld64/unit-tests/test-cases/section-names-long/main.c +++ b/ld64/unit-tests/test-cases/section-names-long/main.c @@ -1,4 +1,5 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/segment-order/main.c b/ld64/unit-tests/test-cases/segment-order/main.c index df774481..3952f8dd 100644 --- a/ld64/unit-tests/test-cases/segment-order/main.c +++ b/ld64/unit-tests/test-cases/segment-order/main.c @@ -1,4 +1,5 @@ -int main() { return 0; } +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/shared-cache-dylib/foo.c b/ld64/unit-tests/test-cases/shared-cache-dylib/foo.c index 68edc410..308bf5ca 100644 --- a/ld64/unit-tests/test-cases/shared-cache-dylib/foo.c +++ b/ld64/unit-tests/test-cases/shared-cache-dylib/foo.c @@ -2,5 +2,6 @@ int x; -int foo() { return x; } +int +foo (void) { return x; } diff --git a/ld64/unit-tests/test-cases/slow-x86-stubs/hello.c b/ld64/unit-tests/test-cases/slow-x86-stubs/hello.c index fe3b0df7..8f0b6f9b 100644 --- a/ld64/unit-tests/test-cases/slow-x86-stubs/hello.c +++ b/ld64/unit-tests/test-cases/slow-x86-stubs/hello.c @@ -1,6 +1,7 @@ #include -int main() +int +main (void) { fprintf(stdout, "hello\n"); return 0; diff --git a/ld64/unit-tests/test-cases/special-labels/main.c b/ld64/unit-tests/test-cases/special-labels/main.c index 5c73586a..2a558997 100644 --- a/ld64/unit-tests/test-cases/special-labels/main.c +++ b/ld64/unit-tests/test-cases/special-labels/main.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/stabs-directory-slash/main.c b/ld64/unit-tests/test-cases/stabs-directory-slash/main.c index a46866d9..987ab0b3 100644 --- a/ld64/unit-tests/test-cases/stabs-directory-slash/main.c +++ b/ld64/unit-tests/test-cases/stabs-directory-slash/main.c @@ -1,4 +1,5 @@ -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/stack_addr_no_size/main.c b/ld64/unit-tests/test-cases/stack_addr_no_size/main.c index 5c73586a..2a558997 100644 --- a/ld64/unit-tests/test-cases/stack_addr_no_size/main.c +++ b/ld64/unit-tests/test-cases/stack_addr_no_size/main.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/stack_addr_size/main.c b/ld64/unit-tests/test-cases/stack_addr_size/main.c index 5c73586a..2a558997 100644 --- a/ld64/unit-tests/test-cases/stack_addr_size/main.c +++ b/ld64/unit-tests/test-cases/stack_addr_size/main.c @@ -23,7 +23,8 @@ */ #include -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/stack_size_no_addr/main.c b/ld64/unit-tests/test-cases/stack_size_no_addr/main.c index 4aaef3a6..1450ce53 100644 --- a/ld64/unit-tests/test-cases/stack_size_no_addr/main.c +++ b/ld64/unit-tests/test-cases/stack_size_no_addr/main.c @@ -31,7 +31,8 @@ static char buffer[100000000]; static char buffer[2000000000]; #endif -int main() +int +main (void) { return buffer[0]; } diff --git a/ld64/unit-tests/test-cases/static-executable-pie/bad.c b/ld64/unit-tests/test-cases/static-executable-pie/bad.c index 40f06147..3bd06b0e 100644 --- a/ld64/unit-tests/test-cases/static-executable-pie/bad.c +++ b/ld64/unit-tests/test-cases/static-executable-pie/bad.c @@ -1,6 +1,7 @@ static int my; -int getmy() +int +getmy (void) { #if __x86_64__ __asm(" .quad _my"); diff --git a/ld64/unit-tests/test-cases/static-executable-pie/test.c b/ld64/unit-tests/test-cases/static-executable-pie/test.c index 4d09a3ab..faa0805a 100644 --- a/ld64/unit-tests/test-cases/static-executable-pie/test.c +++ b/ld64/unit-tests/test-cases/static-executable-pie/test.c @@ -4,14 +4,16 @@ int b = 5; int* pa = &a; int* pb = &b; -int foo() +int +foo (void) { *pa = 4; return a+b; } -int entry() +int +entry (void) { return foo(); } diff --git a/ld64/unit-tests/test-cases/static-executable/test.c b/ld64/unit-tests/test-cases/static-executable/test.c index 57b349af..84c58a84 100644 --- a/ld64/unit-tests/test-cases/static-executable/test.c +++ b/ld64/unit-tests/test-cases/static-executable/test.c @@ -2,13 +2,15 @@ int a; int b = 5; -int foo() +int +foo (void) { return a+b; } -int entry() +int +entry (void) { return foo(); } diff --git a/ld64/unit-tests/test-cases/static-strip/test.c b/ld64/unit-tests/test-cases/static-strip/test.c index ab472fbb..619bf2de 100644 --- a/ld64/unit-tests/test-cases/static-strip/test.c +++ b/ld64/unit-tests/test-cases/static-strip/test.c @@ -22,7 +22,8 @@ * @APPLE_LICENSE_HEADER_END@ */ -int main() +int +main (void) { return 0; } diff --git a/ld64/unit-tests/test-cases/strip_local/hello.c b/ld64/unit-tests/test-cases/strip_local/hello.c index 09e802f6..a1d2c961 100644 --- a/ld64/unit-tests/test-cases/strip_local/hello.c +++ b/ld64/unit-tests/test-cases/strip_local/hello.c @@ -26,7 +26,8 @@ extern int data; extern void func(int); -int main() +int +main (void) { func(data); return 0; diff --git a/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/a.c b/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/a.c index 141b6d93..6d0fb00e 100644 --- a/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/a.c +++ b/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/a.c @@ -1,7 +1,8 @@ int aData = 0; -void a() +void +a (void) { ++aData; } diff --git a/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/b.c b/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/b.c index 9608402e..1304a1e4 100644 --- a/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/b.c +++ b/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/b.c @@ -1,12 +1,14 @@ int bData = 0; -void b() +void +b (void) { ++bData; } -void bb() +void +bb (void) { ++bData; } diff --git a/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/c.c b/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/c.c index db8276a6..f7fd0728 100644 --- a/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/c.c +++ b/ld64/unit-tests/test-cases/stripped-indirect-symbol-table/c.c @@ -4,7 +4,8 @@ extern void bb(); extern void func(void*); -void c() +void +c (void) { func(&b); func(&bb); diff --git a/ld64/unit-tests/test-cases/stub-generation-weak/foo.c b/ld64/unit-tests/test-cases/stub-generation-weak/foo.c index 0122e53d..bbff36c4 100644 --- a/ld64/unit-tests/test-cases/stub-generation-weak/foo.c +++ b/ld64/unit-tests/test-cases/stub-generation-weak/foo.c @@ -1,5 +1,8 @@ -void foo() {} -void bar() {} -void baz() {} +void +foo (void) {} +void +bar (void) {} +void +baz (void) {} diff --git a/ld64/unit-tests/test-cases/stub-generation/test.c b/ld64/unit-tests/test-cases/stub-generation/test.c index 4573622f..161952f3 100644 --- a/ld64/unit-tests/test-cases/stub-generation/test.c +++ b/ld64/unit-tests/test-cases/stub-generation/test.c @@ -25,13 +25,15 @@ const char kMyStr[] = "hello"; -int test() +int +test (void) { return 10; } -const char* getstr() +const char * +getstr (void) { test(); return kMyStr; diff --git a/ld64/unit-tests/test-cases/switch-jump-table/main.c b/ld64/unit-tests/test-cases/switch-jump-table/main.c index f44b624b..a40f88d4 100644 --- a/ld64/unit-tests/test-cases/switch-jump-table/main.c +++ b/ld64/unit-tests/test-cases/switch-jump-table/main.c @@ -1,4 +1,5 @@ -int main() +int +main (void) { return 0; } \ No newline at end of file diff --git a/ld64/unit-tests/test-cases/symbol-hiding-umbrella/bar.c b/ld64/unit-tests/test-cases/symbol-hiding-umbrella/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/symbol-hiding-umbrella/bar.c +++ b/ld64/unit-tests/test-cases/symbol-hiding-umbrella/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/symbol-hiding-umbrella/foo.c b/ld64/unit-tests/test-cases/symbol-hiding-umbrella/foo.c index d946cb4c..d88fc439 100644 --- a/ld64/unit-tests/test-cases/symbol-hiding-umbrella/foo.c +++ b/ld64/unit-tests/test-cases/symbol-hiding-umbrella/foo.c @@ -1,5 +1,6 @@ -void foo() {} +void +foo (void) {} #define SYMBOL_NOT_HERE_IN_10_6(sym) \ extern const char sym##_tmp __asm("$ld$hide$os10.6$_" #sym ); const char sym##_tmp = 0; diff --git a/ld64/unit-tests/test-cases/symbol-hiding-umbrella/main.c b/ld64/unit-tests/test-cases/symbol-hiding-umbrella/main.c index 8c9c95c2..f16ce4cf 100644 --- a/ld64/unit-tests/test-cases/symbol-hiding-umbrella/main.c +++ b/ld64/unit-tests/test-cases/symbol-hiding-umbrella/main.c @@ -3,7 +3,8 @@ extern void foo(); extern void bar(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo1.c b/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo1.c index c6d43676..3fff0e93 100644 --- a/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo1.c +++ b/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo1.c @@ -1 +1,2 @@ -void foo1() {} +void +foo1 (void) {} diff --git a/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo2.c b/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo2.c index a5b73164..2e864ffd 100644 --- a/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo2.c +++ b/ld64/unit-tests/test-cases/symbol-move-and-section-rename/foo2.c @@ -1 +1,2 @@ -void foo2() {} +void +foo2 (void) {} diff --git a/ld64/unit-tests/test-cases/symbol-move-and-section-rename/main.c b/ld64/unit-tests/test-cases/symbol-move-and-section-rename/main.c index 9b080ab5..e39e7264 100644 --- a/ld64/unit-tests/test-cases/symbol-move-and-section-rename/main.c +++ b/ld64/unit-tests/test-cases/symbol-move-and-section-rename/main.c @@ -1,17 +1,21 @@ -void mm() +void +mm (void) { } -void s1() { +void +s1 (void) { mm(); } -void s2() { +void +s2 (void) { mm(); } -int main() +int +main (void) { s1(); s2(); diff --git a/ld64/unit-tests/test-cases/symbol-moving/aaa.c b/ld64/unit-tests/test-cases/symbol-moving/aaa.c index 71123ebe..8f1a9487 100644 --- a/ld64/unit-tests/test-cases/symbol-moving/aaa.c +++ b/ld64/unit-tests/test-cases/symbol-moving/aaa.c @@ -1,3 +1,4 @@ -void aaa() {} +void +aaa (void) {} diff --git a/ld64/unit-tests/test-cases/symbol-moving/bar.c b/ld64/unit-tests/test-cases/symbol-moving/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/symbol-moving/bar.c +++ b/ld64/unit-tests/test-cases/symbol-moving/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/symbol-moving/bbb.c b/ld64/unit-tests/test-cases/symbol-moving/bbb.c index b6e9cc02..140e707f 100644 --- a/ld64/unit-tests/test-cases/symbol-moving/bbb.c +++ b/ld64/unit-tests/test-cases/symbol-moving/bbb.c @@ -1 +1,2 @@ -void bbb() {} +void +bbb (void) {} diff --git a/ld64/unit-tests/test-cases/symbol-moving/foo.c b/ld64/unit-tests/test-cases/symbol-moving/foo.c index 6924ac69..7ef0f0ec 100644 --- a/ld64/unit-tests/test-cases/symbol-moving/foo.c +++ b/ld64/unit-tests/test-cases/symbol-moving/foo.c @@ -1,3 +1,4 @@ -void foo() {} +void +foo (void) {} diff --git a/ld64/unit-tests/test-cases/symbol-moving/main.c b/ld64/unit-tests/test-cases/symbol-moving/main.c index 902e9087..25d2a00d 100644 --- a/ld64/unit-tests/test-cases/symbol-moving/main.c +++ b/ld64/unit-tests/test-cases/symbol-moving/main.c @@ -6,7 +6,8 @@ extern void aaa(); extern void bbb(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/symbol-resolver-basic/foo.c b/ld64/unit-tests/test-cases/symbol-resolver-basic/foo.c index c6a39d97..469ddacc 100644 --- a/ld64/unit-tests/test-cases/symbol-resolver-basic/foo.c +++ b/ld64/unit-tests/test-cases/symbol-resolver-basic/foo.c @@ -24,13 +24,15 @@ -int foo_real() +int +foo_real (void) { return 10; } // This foo is a "resolver" function that return the actual address of "foo" -void* foo() +void * +foo (void) { __asm__(".desc _foo, 0x100"); return &foo_real; diff --git a/ld64/unit-tests/test-cases/symbol-section-move/main.c b/ld64/unit-tests/test-cases/symbol-section-move/main.c index 407d4ad7..713b279f 100644 --- a/ld64/unit-tests/test-cases/symbol-section-move/main.c +++ b/ld64/unit-tests/test-cases/symbol-section-move/main.c @@ -1,39 +1,49 @@ -void mm() +void +mm (void) { } -static void s1() { +static void +s1 (void) { mm(); } -static void s2() { +static void +s2 (void) { mm(); } -int main() +int +main (void) { s1(); s2(); return 0; } -const char* version() { return "1.0"; } +const char * +version (void) { return "1.0"; } -static int mylocal() +static int +mylocal (void) { return 0; } -void* mainget() { return mylocal; } +void * +mainget (void) { return mylocal; } -double getpi() { return 3.1415926535; } +double +getpi (void) { return 3.1415926535; } -void foo() +void +foo (void) { } -void bar() +void +bar (void) { } diff --git a/ld64/unit-tests/test-cases/symbol-section-move/other.c b/ld64/unit-tests/test-cases/symbol-section-move/other.c index 37d5047f..8f88c200 100644 --- a/ld64/unit-tests/test-cases/symbol-section-move/other.c +++ b/ld64/unit-tests/test-cases/symbol-section-move/other.c @@ -1,9 +1,11 @@ -static int mylocal() +static int +mylocal (void) { return 1; } -void* otherget() { return mylocal; } +void * +otherget (void) { return mylocal; } diff --git a/ld64/unit-tests/test-cases/tentative-and-archive-code/foo_code.c b/ld64/unit-tests/test-cases/tentative-and-archive-code/foo_code.c index 277b5aea..fc6ef7d4 100644 --- a/ld64/unit-tests/test-cases/tentative-and-archive-code/foo_code.c +++ b/ld64/unit-tests/test-cases/tentative-and-archive-code/foo_code.c @@ -1,3 +1,4 @@ -int foo() { return 10; } +int +foo (void) { return 10; } diff --git a/ld64/unit-tests/test-cases/tentative-and-archive-code/junk.c b/ld64/unit-tests/test-cases/tentative-and-archive-code/junk.c index 6ecfcf1a..b99476c1 100644 --- a/ld64/unit-tests/test-cases/tentative-and-archive-code/junk.c +++ b/ld64/unit-tests/test-cases/tentative-and-archive-code/junk.c @@ -1 +1,2 @@ -void junk() {} +void +junk (void) {} diff --git a/ld64/unit-tests/test-cases/tentative-and-archive-code/main.c b/ld64/unit-tests/test-cases/tentative-and-archive-code/main.c index 08ed1431..7aa7c4a5 100644 --- a/ld64/unit-tests/test-cases/tentative-and-archive-code/main.c +++ b/ld64/unit-tests/test-cases/tentative-and-archive-code/main.c @@ -1,7 +1,8 @@ int foo; -int main() +int +main (void) { foo = 3; return 0; diff --git a/ld64/unit-tests/test-cases/tentative-and-archive/bar.c b/ld64/unit-tests/test-cases/tentative-and-archive/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/tentative-and-archive/bar.c +++ b/ld64/unit-tests/test-cases/tentative-and-archive/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/tentative-and-archive/foo.c b/ld64/unit-tests/test-cases/tentative-and-archive/foo.c index a2254b59..6d5898d7 100644 --- a/ld64/unit-tests/test-cases/tentative-and-archive/foo.c +++ b/ld64/unit-tests/test-cases/tentative-and-archive/foo.c @@ -1,6 +1,7 @@ extern void bar(); -void foo() { bar(); } +void +foo (void) { bar(); } int var = 9; diff --git a/ld64/unit-tests/test-cases/tentative-and-archive/main.c b/ld64/unit-tests/test-cases/tentative-and-archive/main.c index a01e6b0f..9e016944 100644 --- a/ld64/unit-tests/test-cases/tentative-and-archive/main.c +++ b/ld64/unit-tests/test-cases/tentative-and-archive/main.c @@ -2,7 +2,8 @@ int var; int other_tent; -int main() +int +main (void) { var = 3; return 0; diff --git a/ld64/unit-tests/test-cases/tentative-and-dylib/bar.c b/ld64/unit-tests/test-cases/tentative-and-dylib/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/tentative-and-dylib/bar.c +++ b/ld64/unit-tests/test-cases/tentative-and-dylib/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/tentative-and-dylib/foo.c b/ld64/unit-tests/test-cases/tentative-and-dylib/foo.c index c1bb9195..ed742a7b 100644 --- a/ld64/unit-tests/test-cases/tentative-and-dylib/foo.c +++ b/ld64/unit-tests/test-cases/tentative-and-dylib/foo.c @@ -1,2 +1,3 @@ -void foo() {} +void +foo (void) {} int var = 9; diff --git a/ld64/unit-tests/test-cases/tentative-and-dylib/main.c b/ld64/unit-tests/test-cases/tentative-and-dylib/main.c index e5046a0e..3b038e9a 100644 --- a/ld64/unit-tests/test-cases/tentative-and-dylib/main.c +++ b/ld64/unit-tests/test-cases/tentative-and-dylib/main.c @@ -1,7 +1,8 @@ int var; -int main() +int +main (void) { var = 3; return 0; diff --git a/ld64/unit-tests/test-cases/tentative-to-real-r/test.c b/ld64/unit-tests/test-cases/tentative-to-real-r/test.c index 27d22e72..690d4376 100644 --- a/ld64/unit-tests/test-cases/tentative-to-real-r/test.c +++ b/ld64/unit-tests/test-cases/tentative-to-real-r/test.c @@ -1,5 +1,6 @@ -void foo() {} +void +foo (void) {} int a; int b; diff --git a/ld64/unit-tests/test-cases/thumb-blx/test.c b/ld64/unit-tests/test-cases/thumb-blx/test.c index ce0359ff..ff2ebce3 100644 --- a/ld64/unit-tests/test-cases/thumb-blx/test.c +++ b/ld64/unit-tests/test-cases/thumb-blx/test.c @@ -24,7 +24,8 @@ #include -int main() +int +main (void) { malloc(1); malloc(2); diff --git a/ld64/unit-tests/test-cases/thumb-pointer/bar.c b/ld64/unit-tests/test-cases/thumb-pointer/bar.c index 202a0b39..48e886bf 100644 --- a/ld64/unit-tests/test-cases/thumb-pointer/bar.c +++ b/ld64/unit-tests/test-cases/thumb-pointer/bar.c @@ -1,5 +1,7 @@ -void bar1() {} -void bar2() {} +void +bar1 (void) {} +void +bar2 (void) {} char bar_array[3] = { 1,2,3 }; diff --git a/ld64/unit-tests/test-cases/thumb-pointer/foo.c b/ld64/unit-tests/test-cases/thumb-pointer/foo.c index 96a8a33a..b2324ec5 100644 --- a/ld64/unit-tests/test-cases/thumb-pointer/foo.c +++ b/ld64/unit-tests/test-cases/thumb-pointer/foo.c @@ -4,8 +4,10 @@ extern void bar1(); extern void bar2(); extern char bar_array[]; -void foo1() {} -void foo2() {} +void +foo1 (void) {} +void +foo2 (void) {} char foo_array[3] = { 1,2,3 }; diff --git a/ld64/unit-tests/test-cases/tlv-basic/main.c b/ld64/unit-tests/test-cases/tlv-basic/main.c index b5fd7f63..62129961 100644 --- a/ld64/unit-tests/test-cases/tlv-basic/main.c +++ b/ld64/unit-tests/test-cases/tlv-basic/main.c @@ -30,7 +30,8 @@ extern int* get_b(); extern int* get_c(); extern int* get_d(); -int main() +int +main (void) { int* p; p = get_a(); diff --git a/ld64/unit-tests/test-cases/tlv-dead_strip/main.c b/ld64/unit-tests/test-cases/tlv-dead_strip/main.c index a3e3fee3..165e2b2b 100644 --- a/ld64/unit-tests/test-cases/tlv-dead_strip/main.c +++ b/ld64/unit-tests/test-cases/tlv-dead_strip/main.c @@ -24,7 +24,8 @@ __thread int gTLSThreadID = 0; -int foobar() { +int +foobar (void) { return gTLSThreadID; } diff --git a/ld64/unit-tests/test-cases/tlv-dylib/main.c b/ld64/unit-tests/test-cases/tlv-dylib/main.c index 800356dc..41fb06ac 100644 --- a/ld64/unit-tests/test-cases/tlv-dylib/main.c +++ b/ld64/unit-tests/test-cases/tlv-dylib/main.c @@ -31,7 +31,8 @@ #endif -int main() +int +main (void) { #if USE_FOO_WRONG foo = 1; diff --git a/ld64/unit-tests/test-cases/tlv-r/foo.c b/ld64/unit-tests/test-cases/tlv-r/foo.c index 6f6c6c62..0c3457de 100644 --- a/ld64/unit-tests/test-cases/tlv-r/foo.c +++ b/ld64/unit-tests/test-cases/tlv-r/foo.c @@ -26,7 +26,8 @@ __thread int a = 0; __thread static int b = 0; extern __thread int c; -int foo() { +int +foo (void) { return a+b+c; } diff --git a/ld64/unit-tests/test-cases/umbrella-dylib/main.c b/ld64/unit-tests/test-cases/umbrella-dylib/main.c index 8d0b5b77..d276080e 100644 --- a/ld64/unit-tests/test-cases/umbrella-dylib/main.c +++ b/ld64/unit-tests/test-cases/umbrella-dylib/main.c @@ -1,6 +1,7 @@ extern void c1(); extern void a1(); -int main() +int +main (void) { a1(); c1(); diff --git a/ld64/unit-tests/test-cases/undefined-dynamic-lookup/main.c b/ld64/unit-tests/test-cases/undefined-dynamic-lookup/main.c index 5de972f2..3ac388e9 100644 --- a/ld64/unit-tests/test-cases/undefined-dynamic-lookup/main.c +++ b/ld64/unit-tests/test-cases/undefined-dynamic-lookup/main.c @@ -25,7 +25,8 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/unexported_symbols_list-r/foo.c b/ld64/unit-tests/test-cases/unexported_symbols_list-r/foo.c index 7bb9849b..42c54340 100644 --- a/ld64/unit-tests/test-cases/unexported_symbols_list-r/foo.c +++ b/ld64/unit-tests/test-cases/unexported_symbols_list-r/foo.c @@ -2,8 +2,10 @@ extern int fooCount; extern int barCount; -void foo() { fooCount++; } -void bar() { barCount++; } +void +foo (void) { fooCount++; } +void +bar (void) { barCount++; } int global = 4; int googoo = 5; diff --git a/ld64/unit-tests/test-cases/visibility-warning-dylib-v-archive/main.c b/ld64/unit-tests/test-cases/visibility-warning-dylib-v-archive/main.c index 8c9c95c2..f16ce4cf 100644 --- a/ld64/unit-tests/test-cases/visibility-warning-dylib-v-archive/main.c +++ b/ld64/unit-tests/test-cases/visibility-warning-dylib-v-archive/main.c @@ -3,7 +3,8 @@ extern void foo(); extern void bar(); -int main() +int +main (void) { foo(); bar(); diff --git a/ld64/unit-tests/test-cases/visibility-warning/foo.c b/ld64/unit-tests/test-cases/visibility-warning/foo.c index 16247579..ae1d5939 100644 --- a/ld64/unit-tests/test-cases/visibility-warning/foo.c +++ b/ld64/unit-tests/test-cases/visibility-warning/foo.c @@ -1,5 +1,6 @@ -void foo() +void +foo (void) { } diff --git a/ld64/unit-tests/test-cases/weak-def-ordinal/bar.c b/ld64/unit-tests/test-cases/weak-def-ordinal/bar.c index ae61731b..6c7b1656 100644 --- a/ld64/unit-tests/test-cases/weak-def-ordinal/bar.c +++ b/ld64/unit-tests/test-cases/weak-def-ordinal/bar.c @@ -1,5 +1,6 @@ -int aaa() +int +aaa (void) { return 1; } diff --git a/ld64/unit-tests/test-cases/weak-def-ordinal/main.c b/ld64/unit-tests/test-cases/weak-def-ordinal/main.c index 74726fba..33955c19 100644 --- a/ld64/unit-tests/test-cases/weak-def-ordinal/main.c +++ b/ld64/unit-tests/test-cases/weak-def-ordinal/main.c @@ -26,7 +26,8 @@ extern void aaa(); extern void bbb(); -int main() +int +main (void) { aaa(); bbb(); diff --git a/ld64/unit-tests/test-cases/weak_dylib/bar.c b/ld64/unit-tests/test-cases/weak_dylib/bar.c index 261a806c..dcdebed6 100644 --- a/ld64/unit-tests/test-cases/weak_dylib/bar.c +++ b/ld64/unit-tests/test-cases/weak_dylib/bar.c @@ -2,8 +2,12 @@ #include "bar.h" -void bar1() {} -void bar2() {} -void bar3() {} -void bar4() {} +void +bar1 (void) {} +void +bar2 (void) {} +void +bar3 (void) {} +void +bar4 (void) {} diff --git a/ld64/unit-tests/test-cases/weak_dylib/foo.c b/ld64/unit-tests/test-cases/weak_dylib/foo.c index aa25da50..9d150740 100644 --- a/ld64/unit-tests/test-cases/weak_dylib/foo.c +++ b/ld64/unit-tests/test-cases/weak_dylib/foo.c @@ -2,8 +2,12 @@ #include "foo.h" -void foo1() {} -void foo2() {} -void foo3() {} -void foo4() {} +void +foo1 (void) {} +void +foo2 (void) {} +void +foo3 (void) {} +void +foo4 (void) {} diff --git a/ld64/unit-tests/test-cases/weak_import-disable/foo.c b/ld64/unit-tests/test-cases/weak_import-disable/foo.c index 260977e5..7c3fe002 100644 --- a/ld64/unit-tests/test-cases/weak_import-disable/foo.c +++ b/ld64/unit-tests/test-cases/weak_import-disable/foo.c @@ -1,12 +1,14 @@ -void foo() {} +void +foo (void) {} #define WEAK_IMPORT_FOR_10_7(sym) \ extern const char sym##_tmp __asm("$ld$weak$os10.7$_" #sym ); const char sym##_tmp = 0; -void bar() {} +void +bar (void) {} WEAK_IMPORT_FOR_10_7(bar) diff --git a/ld64/unit-tests/test-cases/weak_import-disable/main2.c b/ld64/unit-tests/test-cases/weak_import-disable/main2.c index d908e873..77aecd84 100644 --- a/ld64/unit-tests/test-cases/weak_import-disable/main2.c +++ b/ld64/unit-tests/test-cases/weak_import-disable/main2.c @@ -4,7 +4,8 @@ extern void bar(); -int main() +int +main (void) { bar(); return 0; diff --git a/ld64/unit-tests/test-cases/weak_import-force/bar.c b/ld64/unit-tests/test-cases/weak_import-force/bar.c index 611f2d9e..67aa5e7e 100644 --- a/ld64/unit-tests/test-cases/weak_import-force/bar.c +++ b/ld64/unit-tests/test-cases/weak_import-force/bar.c @@ -1,8 +1,10 @@ -void bar1() {} -void bar2() {} +void +bar1 (void) {} +void +bar2 (void) {} int bar_data1 = 0; diff --git a/ld64/unit-tests/test-cases/weak_import-force/foo.c b/ld64/unit-tests/test-cases/weak_import-force/foo.c index c0bbc1e8..fd6c7f4e 100644 --- a/ld64/unit-tests/test-cases/weak_import-force/foo.c +++ b/ld64/unit-tests/test-cases/weak_import-force/foo.c @@ -1,8 +1,10 @@ -void foo1() {} -void foo2() {} +void +foo1 (void) {} +void +foo2 (void) {} int foo_data1 = 0; diff --git a/ld64/unit-tests/test-cases/weak_import-local/foo.c b/ld64/unit-tests/test-cases/weak_import-local/foo.c index 6eabcc72..875dc6b8 100644 --- a/ld64/unit-tests/test-cases/weak_import-local/foo.c +++ b/ld64/unit-tests/test-cases/weak_import-local/foo.c @@ -2,6 +2,7 @@ #include "foo.h" -void func2() {} +void +func2 (void) {} int data2 = 0; // weak_import initialized diff --git a/ld64/unit-tests/test-cases/weak_import/foo.c b/ld64/unit-tests/test-cases/weak_import/foo.c index 900b052e..bf20c81d 100644 --- a/ld64/unit-tests/test-cases/weak_import/foo.c +++ b/ld64/unit-tests/test-cases/weak_import/foo.c @@ -2,10 +2,14 @@ #include "foo.h" -void func1() {} -void func2() {} -void func3() {} -void func4() {} +void +func1 (void) {} +void +func2 (void) {} +void +func3 (void) {} +void +func4 (void) {} int data1 = 0; diff --git a/ld64/unit-tests/test-cases/weak_import2/foo.c b/ld64/unit-tests/test-cases/weak_import2/foo.c index 900b052e..bf20c81d 100644 --- a/ld64/unit-tests/test-cases/weak_import2/foo.c +++ b/ld64/unit-tests/test-cases/weak_import2/foo.c @@ -2,10 +2,14 @@ #include "foo.h" -void func1() {} -void func2() {} -void func3() {} -void func4() {} +void +func1 (void) {} +void +func2 (void) {} +void +func3 (void) {} +void +func4 (void) {} int data1 = 0; diff --git a/ld64/unit-tests/test-cases/weak_import2/foo1.c b/ld64/unit-tests/test-cases/weak_import2/foo1.c index 4580a87d..b690af4c 100644 --- a/ld64/unit-tests/test-cases/weak_import2/foo1.c +++ b/ld64/unit-tests/test-cases/weak_import2/foo1.c @@ -1,7 +1,9 @@ -void func2() {} -void func4() {} +void +func2 (void) {} +void +func4 (void) {} int data2 = 0; // foo.c also has weak_import initialized diff --git a/ld64/unit-tests/test-cases/why_live/bar.c b/ld64/unit-tests/test-cases/why_live/bar.c index e4259998..7572dde3 100644 --- a/ld64/unit-tests/test-cases/why_live/bar.c +++ b/ld64/unit-tests/test-cases/why_live/bar.c @@ -1 +1,2 @@ -void bar() {} +void +bar (void) {} diff --git a/ld64/unit-tests/test-cases/why_live/foo.c b/ld64/unit-tests/test-cases/why_live/foo.c index 9a2edf54..2a02efbc 100644 --- a/ld64/unit-tests/test-cases/why_live/foo.c +++ b/ld64/unit-tests/test-cases/why_live/foo.c @@ -1,12 +1,14 @@ extern void bar(); -void foo() +void +foo (void) { bar(); } -void frob() +void +frob (void) { bar(); } \ No newline at end of file diff --git a/ld64/unit-tests/test-cases/why_live/main.c b/ld64/unit-tests/test-cases/why_live/main.c index a5a79d52..854a1bb3 100644 --- a/ld64/unit-tests/test-cases/why_live/main.c +++ b/ld64/unit-tests/test-cases/why_live/main.c @@ -1,6 +1,7 @@ extern void foo(); -int main() +int +main (void) { foo(); return 0; diff --git a/ld64/unit-tests/test-cases/zero-fill/test.c b/ld64/unit-tests/test-cases/zero-fill/test.c index cfdc08c7..ec7073e5 100644 --- a/ld64/unit-tests/test-cases/zero-fill/test.c +++ b/ld64/unit-tests/test-cases/zero-fill/test.c @@ -38,7 +38,8 @@ static int staticbigarray4[256]; static int staticbigarray5[256]; static int staticbigarray6[256]; -int main() +int +main (void) { staticbigarray1[10] = 4; staticbigarray2[10] = 4; diff --git a/ld64/unit-tests/test-cases/zero-fill2/test.c b/ld64/unit-tests/test-cases/zero-fill2/test.c index 94bf64db..d6311b33 100644 --- a/ld64/unit-tests/test-cases/zero-fill2/test.c +++ b/ld64/unit-tests/test-cases/zero-fill2/test.c @@ -48,7 +48,8 @@ static int staticbigarray5[2560000]; #ifndef __arm__ static int staticbigarray6[25600000*BOOST]; #endif -int main() +int +main (void) { staticbigarray1[10] = 4; staticbigarray2[10] = 4; diff --git a/ld64/unit-tests/test-cases/zero-fill3/test.c b/ld64/unit-tests/test-cases/zero-fill3/test.c index 64ac72a9..de404e74 100644 --- a/ld64/unit-tests/test-cases/zero-fill3/test.c +++ b/ld64/unit-tests/test-cases/zero-fill3/test.c @@ -44,7 +44,8 @@ static int staticbigarray5[2560000]; static int staticbigarray6[25600000]; //static int staticbigarray99[2147483647U/SHRINK]; -int main() +int +main (void) { bigarray5[10] = 4; bigarray7[10] = 4; diff --git a/libyaml b/libyaml new file mode 160000 index 00000000..840b65c4 --- /dev/null +++ b/libyaml @@ -0,0 +1 @@ +Subproject commit 840b65c40675e2d06bf40405ad3f12dec7f35923 diff --git a/tapilite/CMakeLists.txt b/tapilite/CMakeLists.txt new file mode 100644 index 00000000..e24b0fcf --- /dev/null +++ b/tapilite/CMakeLists.txt @@ -0,0 +1,39 @@ + +set(TAPI_FULL_VERSION "2.0.3" CACHE STRING "Specify tapi version.") +message(STATUS "TAPI version: ${TAPI_FULL_VERSION}") + +set(TAPI_APPLE_VERSION "1000.10.8" CACHE STRING "Specify tapi version.") +message(STATUS "APPLE Tapi version: ${TAPI_APPLE_VERSION}") + +set(TAPI_REPOSITORY_STRING "https://github.com/grobian/darwin-xtools.git" CACHE STRING + "Vendor-specific text for showing the repository the source is taken from.") + +if(TAPI_REPOSITORY_STRING) + add_definitions(-DTAPI_REPOSITORY_STRING="${TAPI_REPOSITORY_STRING}") +endif() + +set(TAPI_VENDOR "tapilite" CACHE STRING + "Vendor-specific text for showing with version information.") + +if (TAPI_VENDOR) + add_definitions( -DTAPI_VENDOR="${TAPI_VENDOR} ") +endif() + +if (TAPI_APPLE_VERSION) + add_definitions( -DAPPLE_VERSION="${TAPI_APPLE_VERSION}") +endif () + +set(TAPI_CXX_FLAGS) +if(XTOOLS_C_HAS_FNOCOMMON_FLAG) + set(TAPI_CXX_FLAGS "-fno-common") +endif() +if(XTOOLS_CXX_HAS_STDCXX11_FLAG) + set(TAPI_CXX_FLAGS "${TAPI_CXX_FLAGS} -std=c++11") +endif() +if(XTOOLS_CXX_HAS_STDLIB_FLAG) + set(TAPI_CXX_FLAGS "${TAPI_CXX_FLAGS} -stdlib=libc++") +endif() + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TAPI_CXX_FLAGS} ") + +add_subdirectory(src) diff --git a/tapilite/LICENSE.TXT b/tapilite/LICENSE.TXT new file mode 100644 index 00000000..06e331e3 --- /dev/null +++ b/tapilite/LICENSE.TXT @@ -0,0 +1,62 @@ +============================================================================== +tapi License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2011-2014 by the contributors listed in CREDITS.TXT +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== +The lld software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the lld Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- + diff --git a/tapilite/README b/tapilite/README new file mode 100644 index 00000000..a28fe137 --- /dev/null +++ b/tapilite/README @@ -0,0 +1,6 @@ +This is a very minimal, LLVM-independent implementation of TAPI, such +that we can compile (and bootstrap) a linker that will be usable on +recent macOS without the need for LLVM. + +dependencies: libyaml +provides: required interfaces from ld64/src/ld/parsers/textstub_dylib_file diff --git a/tapilite/include/tapi/Defines.h b/tapilite/include/tapi/Defines.h new file mode 100644 index 00000000..00f6f2f9 --- /dev/null +++ b/tapilite/include/tapi/Defines.h @@ -0,0 +1,32 @@ +//===-- tapi/Defines.h - TAPI C++ Library Defines ---------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief TAPI C++ library defines. +/// \since 1.0 +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#ifndef TAPI_DEFINES_H +#define TAPI_DEFINES_H + +#define TAPI_INTERNAL tapi::internal +#define TAPI_NAMESPACE_INTERNAL_BEGIN namespace tapi { namespace internal { +#define TAPI_NAMESPACE_INTERNAL_END } } + +#define TAPI_NAMESPACE_V1_BEGIN namespace tapi { inline namespace v1 { +#define TAPI_NAMESPACE_V1_END } } + +#define TAPI_PUBLIC __attribute__((visibility ("default"))) + +#endif // TAPI_DEFINES_H + diff --git a/tapilite/include/tapi/LinkerInterfaceFile.h b/tapilite/include/tapi/LinkerInterfaceFile.h new file mode 100644 index 00000000..51b82637 --- /dev/null +++ b/tapilite/include/tapi/LinkerInterfaceFile.h @@ -0,0 +1,496 @@ +//===-- tapi/LinkerInterfaceFile.h - TAPI File Interface --------*- C++ -*-===*\ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief API for reading TAPI files. +/// \since 1.0 +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#ifndef TAPI_LINKER_INTERFACE_FILE_H +#define TAPI_LINKER_INTERFACE_FILE_H + +#include +#include +#include +#include + +/// +/// \defgroup TAPI_LINKER_INTERFACE_FILE TAPI File APIs +/// \ingroup TAPI_CPP_API +/// +/// @{ +/// + +using cpu_type_t = int; +using cpu_subtype_t = int; + +TAPI_NAMESPACE_V1_BEGIN + +class PackedVersion32; +class Symbol; + +/// +/// \brief Defines a list of supported platforms. +/// \since 1.0 +/// +enum class Platform : unsigned { + /// \brief Unknown platform + /// \since 1.0 + Unknown = 0, + + /// \brief Mac OS X + /// \since 1.0 + OSX = 1, + + /// \brief iOS + /// \since 1.0 + iOS = 2, + + /// \brief watchOS + /// \since 1.0 + watchOS = 3, + + /// \brief tvOS + /// \since 1.0 + tvOS = 4, + + /// \brief bridgeOS + /// \since 1.2 + bridgeOS = 5, + + /// \brief zippered + /// \since 2.0 + zippered = 6, +}; + +/// +/// \brief Defines a list of Objective-C constraints. +/// \since 1.0 +/// +enum class ObjCConstraint : unsigned { + /// \brief No constraint. + /// \since 1.0 + None = 0, + + /// \brief Retain/Release. + /// \since 1.0 + Retain_Release = 1, + + /// \brief Retain/Release for Simulator. + /// \since 1.0 + Retain_Release_For_Simulator = 2, + + /// \brief Retain/Release or Garbage Collection. + /// \since 1.0 + Retain_Release_Or_GC = 3, + + /// \brief Garbage Collection. + /// \since 1.0 + GC = 4, +}; + +/// +/// \brief Defines a list of supported file types. +/// \since 1.0 +/// +enum class FileType : unsigned { + /// \brief Unsupported file type. + /// \since 1.0 + Unsupported = 0, + + /// \brief Text-based Dynamic Library Stub File (.tbd) version 1.0 + /// \since 1.0 + TBD_V1 = 1, + + /// \brief Text-based stub file (.tbd) version 2.0 + /// \since 1.0 + TBD_V2 = 2, + + /// \brief Text-based stub file (.tbd) version 3.0 + /// \since 1.3 + TBD_V3 = 3, + + /// format as seen on Big Sur + TBD_V4 = 4, +}; + +/// +/// \brief Defines the cpu subtype matching mode. +/// \since 1.0 +/// +enum class CpuSubTypeMatching : unsigned { + /// \brief Fall-back to an ABI compatible slice if an exact match cannot be + /// found. + /// \since 1.0 + ABI_Compatible = 0, + + /// \brief Only accept a slice if the sub type matches. + /// \since 1.0 + Exact = 1, +}; + +/// +/// \brief Defines flags that control the parsing of text-based stub files. +/// \since 1.1 +/// +enum ParsingFlags : unsigned { + /// \brief Default flags. + /// \since 1.1 + None = 0, + + /// \brief Only accept a slice if the sub type matches. ABI fall-back mode is + /// the default. + /// \since 1.1 + ExactCpuSubType = 1U << 0, + + /// \brief Disallow weak imported symbols. This adds weak imported symbols to + /// the ignore exports list. + /// \since 1.1 + DisallowWeakImports = 1U << 1, +}; + +inline ParsingFlags operator|(ParsingFlags lhs, ParsingFlags rhs) noexcept { + return static_cast(static_cast(lhs) | + static_cast(rhs)); +} + +inline ParsingFlags operator|=(ParsingFlags &lhs, ParsingFlags rhs) noexcept { + lhs = lhs | rhs; + return lhs; +} + +/// +/// \brief TAPI File APIs +/// \since 1.0 +/// +class TAPI_PUBLIC LinkerInterfaceFile { +public: + /// + /// \brief Returns a list of supported file extensions. + /// + /// \returns a list of supported file extensions. + /// \since 1.0 + /// + static std::vector getSupportedFileExtensions() noexcept; + + /// + /// \brief Indicate if the provided buffer is a supported Text-based Dynamic + /// Library Stub file. + /// + /// Checks if the buffer is a supported format. This doesn't check for + /// malformed buffer content. + /// + /// \param[in] path full path to the file. + /// \param[in] data raw pointer to start of buffer. + /// \param[in] size size of the buffer in bytes. + /// \returns true if the format is supported. + /// \since 1.0 + /// + static bool isSupported(const std::string &path, const uint8_t *data, + size_t size) noexcept; + + /// + /// \brief Check if we should prefer the text-based stub file. + /// + /// \param[in] path full path to the text-based stub file. + /// \returns true if the tex-based stub file should be prefered over any + /// dynamic library. + /// \since 1.0 + /// + static bool shouldPreferTextBasedStubFile(const std::string &path) noexcept; + + /// + /// \brief Check if the text-based stub file and the MachO dynamic library + /// file are in sync. + /// + /// This validates both files against each other and checks if both files are + /// still in sync. + /// + /// \param[in] tbdPath full path to the text-based stub file. + /// \param[in] dylibPath full path to the MachO dynamic library file. + /// \returns true if both files are in sync. + /// \since 1.0 + /// + static bool areEquivalent(const std::string &tbdPath, + const std::string &dylibPath) noexcept; + + /// + /// \brief Create a LinkerInterfaceFile from the provided buffer. + /// + /// Parses the content of the provided buffer with the given constrains for + /// cpu type, cpu sub-type, matching requirement, and minimum deployment + /// version. + /// + /// \param[in] path path to the file (for error message only). + /// \param[in] data raw pointer to start of buffer. + /// \param[in] size size of the buffer in bytes. + /// \param[in] cpuType The cpu type / architecture to check the file for. + /// \param[in] cpuSubType The cpu sub type / sub architecture to check the + /// file for. + /// \param[in] matchingMode Specified the cpu subtype matching mode. + /// \param[in] minOSVersion The minimum OS version / deployment target. + /// \param[out] errorMessage holds an error message when the return value is a + /// nullptr. + /// \return nullptr on error + /// \since 1.0 + /// \deprecated 1.1 + /// + static LinkerInterfaceFile * + create(const std::string &path, const uint8_t *data, size_t size, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, + CpuSubTypeMatching matchingMode, PackedVersion32 minOSVersion, + std::string &errorMessage) noexcept; + + /// + /// \brief Create a LinkerInterfaceFile from the provided buffer. + /// + /// Parses the content of the provided buffer with the given constrains for + /// cpu type, cpu sub-type, flags, and minimum deployment version. + /// + /// \param[in] path path to the file (for error message only). + /// \param[in] data raw pointer to start of buffer. + /// \param[in] size size of the buffer in bytes. + /// \param[in] cpuType The cpu type / architecture to check the file for. + /// \param[in] cpuSubType The cpu sub type / sub architecture to check the + /// file for. + /// \param[in] flags Flags that control the parsing behavior. + /// \param[in] minOSVersion The minimum OS version / deployment target. + /// \param[out] errorMessage holds an error message when the return value is a + /// nullptr. + /// \return nullptr on error + /// \since 1.1 + /// \deprecated 1.3 + /// + static LinkerInterfaceFile * + create(const std::string &path, const uint8_t *data, size_t size, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, ParsingFlags flags, + PackedVersion32 minOSVersion, std::string &errorMessage) noexcept; + + /// + /// \brief Create a LinkerInterfaceFile from a file. + /// + /// Parses the content of the file with the given constrains for cpu type, + /// cpu sub-type, flags, and minimum deployment version. + /// + /// \param[in] path path to the file. + /// \param[in] cpuType The cpu type / architecture to check the file for. + /// \param[in] cpuSubType The cpu sub type / sub architecture to check the + /// file for. + /// \param[in] flags Flags that control the parsing behavior. + /// \param[in] minOSVersion The minimum OS version / deployment target. + /// \param[out] errorMessage holds an error message when the return value is a + /// nullptr. + /// \return nullptr on error + /// \since 1.3 + /// + static LinkerInterfaceFile * + create(const std::string &path, cpu_type_t cpuType, cpu_subtype_t cpuSubType, + ParsingFlags flags, PackedVersion32 minOSVersion, + std::string &errorMessage) noexcept; + + /// + /// \brief Query the file type. + /// \return Returns the file type this TAPI file represents. + /// \since 1.0 + /// + FileType getFileType() const noexcept; + + /// + /// \brief Query the platform + /// \return Returns the platform supported by the TAPI file. + /// \since 1.0 + /// + Platform getPlatform() const noexcept; + + /// + /// \brief Query the install name. + /// \return Returns the install name of the TAPI file. + /// \since 1.0 + /// + const std::string &getInstallName() const noexcept; + + /// + /// \brief Query the install name is version specifc. + /// \return True if the install name has been adjusted for the provided + /// minimum OS version. + /// \since 1.0 + /// + bool isInstallNameVersionSpecific() const noexcept; + + /// + /// \brief Query the current library version. + /// \return Returns the current library version as 32bit packed version. + /// \since 1.0 + /// + PackedVersion32 getCurrentVersion() const noexcept; + + /// + /// \brief Query the compatibility library version. + /// \return Returns the compatibility library version as 32bit packed version. + /// \since 1.0 + /// + PackedVersion32 getCompatibilityVersion() const noexcept; + + /// + /// \brief Query the Swift ABI version. + /// \return Returns the Swift ABI version as unsigned integer. + /// \since 1.0 + /// + unsigned getSwiftVersion() const noexcept; + + /// + /// \brief Query the Objective-C Constraint. + /// \return Returns the Objetive-C constraint. + /// \since 1.0 + /// + ObjCConstraint getObjCConstraint() const noexcept; + + /// + /// \brief Query if the library has two level namespace. + /// \return Returns true if the library has two level namespace. + /// \since 1.0 + /// + bool hasTwoLevelNamespace() const noexcept; + + /// + /// \brief Query if the library is Applicatiuon Extension Safe. + /// \return Returns true if the library is Application Extension Safe. + /// \since 1.0 + /// + bool isApplicationExtensionSafe() const noexcept; + + /// + /// \brief Query if the library has any allowable clients. + /// \return Return true if there are any allowable clients. + /// \since 1.0 + /// + bool hasAllowableClients() const noexcept; + + /// + /// \brief Query if the library has any re-exported libraries. + /// \return Return true if there are any re-exported libraries. + /// \since 1.0 + /// + bool hasReexportedLibraries() const noexcept; + + /// + /// \brief Query if the library has any weak defined exports. + /// \return Return true if there are any weak defined exports. + /// \since 1.0 + /// + bool hasWeakDefinedExports() const noexcept; + + /// + /// \brief Obtain the name of the parent framework (umbrella framework). + /// \return Returns the name of the parent framework (if it exists), otherwise + /// an empty string. + /// \since 1.0 + /// + const std::string &getParentFrameworkName() const noexcept; + + /// + /// \brief Obtain the list of allowable clients. + /// \return Returns a list of allowable clients. + /// \since 1.0 + /// + const std::vector &allowableClients() const noexcept; + + /// + /// \brief Obtain the list of re-exported libraries. + /// \return Returns a list of re-exported libraries. + /// \since 1.0 + /// + const std::vector &reexportedLibraries() const noexcept; + + /// + /// \brief Obtain a list of all symbols to be ignored. + /// \return Returns a list of all symbols that should be ignored. + /// \since 1.0 + /// + const std::vector &ignoreExports() const noexcept; + + /// + /// \brief Obtain a list of all exported symbols. + /// \return Returns a list of all exported symbols. + /// \since 1.0 + /// + const std::vector &exports() const noexcept; + + /// + /// \brief Obtain a list of all undefined symbols. + /// \return Returns a list of all undefined symbols. + /// \since 1.0 + /// + const std::vector &undefineds() const noexcept; + + /// + /// \brief Obtain a list of all inlined frameworks. + /// \return Returns a list of install names of all inlined frameworks. + /// \since 1.3 + /// + const std::vector &inlinedFrameworkNames() const noexcept; + + /// + /// \brief Create a LinkerInterfaceFile from the specified inlined framework. + /// + /// Creates a LinkerInterfaceFile with the given constrains for cpu type, + /// cpu sub-type, flags, and minimum deployment version. + /// + /// \param[in] installName install name of the inlined framework. + /// \param[in] cpuType The cpu type / architecture to check the file for. + /// \param[in] cpuSubType The cpu sub type / sub architecture to check the + /// file for. + /// \param[in] flags Flags that control the parsing behavior. + /// \param[in] minOSVersion The minimum OS version / deployment target. + /// \param[out] errorMessage holds an error message when the return value is a + /// nullptr. + /// \return nullptr on error + /// \since 1.3 + /// + LinkerInterfaceFile * + getInlinedFramework(const std::string &installName, cpu_type_t cpuType, + cpu_subtype_t cpuSubType, ParsingFlags flags, + PackedVersion32 minOSVersion, + std::string &errorMessage) const noexcept; + + /// + /// \brief Destructor. + /// \since 1.0 + /// + ~LinkerInterfaceFile() noexcept; + + /// + /// \brief Copy constructor (deleted). + /// \since 1.0 + /// + LinkerInterfaceFile(const LinkerInterfaceFile &) noexcept = delete; + LinkerInterfaceFile &operator=(const LinkerInterfaceFile &) noexcept = delete; + + /// + /// \brief Move constructor. + /// \since 1.0 + /// + LinkerInterfaceFile(LinkerInterfaceFile &&) noexcept; + LinkerInterfaceFile &operator=(LinkerInterfaceFile &&) noexcept; + +private: + LinkerInterfaceFile() noexcept; + + class Impl; + class ImplData; + std::unique_ptr _pImpl; +}; + +TAPI_NAMESPACE_V1_END + +#endif // TAPI_LINKER_INTERFACE_FILE_H diff --git a/tapilite/include/tapi/PackedVersion32.h b/tapilite/include/tapi/PackedVersion32.h new file mode 100644 index 00000000..f8d96d0c --- /dev/null +++ b/tapilite/include/tapi/PackedVersion32.h @@ -0,0 +1,109 @@ +//===-- tapi/PackedVersion32.h - TAPI Packed Version 32 ---------*- C++ -*-===*\ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Defines the packed version number. +/// \since 1.0 +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#ifndef TAPI_PACKED_VERSION_32_H +#define TAPI_PACKED_VERSION_32_H + +#include + +/// +/// \defgroup TAPI_PACKED_VERSION_32 Packed Version handling +/// \ingroup TAPI_CPP_API +/// +/// @{ +/// + +TAPI_NAMESPACE_V1_BEGIN + +/// +/// \brief Packed Version Number Encoding. +/// +/// The Mach-O version numbers are commonly encoded as a 32bit value, where the +/// upper 16 bit quantity is used for the major version number and the lower two +/// 8 bit quantities as minor version number and patch version number. +/// +/// \since 1.0 +/// +class TAPI_PUBLIC PackedVersion32 { +private: + uint32_t _version; + +public: + /// + /// \brief Default construct a PackedVersion32. + /// \since 1.0 + /// + PackedVersion32() = default; + + /// + /// \brief Construct a PackedVersion32 with a raw value. + /// \since 1.0 + /// + PackedVersion32(uint32_t rawVersion) : _version(rawVersion) {} + + /// + /// \brief Construct a PackedVersion32 with the provided major, minor, and + /// patch version number. + /// \since 1.0 + /// + PackedVersion32(unsigned major, unsigned minor, unsigned patch) + : _version((major << 16) | ((minor & 0xff) << 8) | (patch & 0xff)) {} + + /// + /// \brief Get the major version number. + /// \return The major version number as unsigned integer. + /// \since 1.0 + /// + unsigned getMajor() const { return _version >> 16; } + + /// + /// \brief Get the minor version number. + /// \return The minor version number as unsigned integer. + /// \since 1.0 + /// + unsigned getMinor() const { return (_version >> 8) & 0xff; } + + /// + /// \brief Get the patch version number. + /// \return The patch version number as unsigned integer. + /// \since 1.0 + /// + unsigned getPatch() const { return _version & 0xff; } + + bool operator<(const PackedVersion32 &rhs) const { + return _version < rhs._version; + } + + bool operator==(const PackedVersion32 &rhs) const { + return _version == rhs._version; + } + + bool operator!=(const PackedVersion32 &rhs) const { + return _version != rhs._version; + } + + operator unsigned() const { return _version; } +}; + +TAPI_NAMESPACE_V1_END + +/// +/// @} +/// + +#endif // TAPI_PACKED_VERSION_32_H diff --git a/tapilite/include/tapi/Symbol.h b/tapilite/include/tapi/Symbol.h new file mode 100644 index 00000000..cb799196 --- /dev/null +++ b/tapilite/include/tapi/Symbol.h @@ -0,0 +1,136 @@ +//===-- tapi/Symbol.h - TAPI Symbol -----------------------------*- C++ -*-===*\ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Defines a symbol. +/// \since 1.0 +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#ifndef TAPI_SYMBOL_H +#define TAPI_SYMBOL_H + +#include + +/// +/// \defgroup TAPI_SYMBOL Symbol API +/// \ingroup TAPI_CPP_API +/// +/// @{ +/// + +TAPI_NAMESPACE_V1_BEGIN + +/// +/// \brief Symbol flags. +/// \since 1.0 +/// +enum class SymbolFlags : unsigned { + /// \brief No flags + /// \since 1.0 + None = 0, + + /// \brief Thread-local value symbol + /// \since 1.0 + ThreadLocalValue = 1U << 0, + + /// \brief Weak defined symbol + /// \since 1.0 + WeakDefined = 1U << 1, + + /// \brief Weak referenced symbol + /// \since 1.0 + WeakReferenced = 1U << 2, +}; + +enum class SymbolKind : unsigned { + GlobalSymbol, + ObjectiveCClass, + ObjectiveCClassEHType, + ObjectiveCInstanceVariable, +}; + +inline SymbolFlags operator&(const SymbolFlags &lhs, + const SymbolFlags &rhs) noexcept { + return static_cast(static_cast(lhs) & + static_cast(rhs)); +} + +/// +/// \brief Provides query methods for symbols. +/// \since 1.0 +/// +class TAPI_PUBLIC Symbol { +public: + template + Symbol(Tp &&name, SymbolFlags flags = SymbolFlags::None, + SymbolKind kind = SymbolKind::GlobalSymbol) + : _name(std::forward(name)), _flags(flags), _kind(kind) {} + + SymbolKind getKind() const { return _kind; } + + /// + /// \brief Get the symbol name as string. + /// \return A string with the symbol name. + /// \since 1.0 + /// + inline const std::string &getName() const noexcept { return _name; } + + /// + /// \brief Obtain the symbol flags. + /// \return Returns the symbol flags. + /// \since 1.0 + /// + inline SymbolFlags getFlags() const noexcept { return _flags; } + + /// + /// \brief Query if the symbol is thread-local. + /// \return True if the symbol is a thread-local value, false otherwise. + /// \since 1.0 + /// + inline bool isThreadLocalValue() const noexcept { + return (_flags & SymbolFlags::ThreadLocalValue) == + SymbolFlags::ThreadLocalValue; + } + + /// + /// \brief Query if the symbol is weak defined. + /// \return True if the symbol is weak defined, false otherwise. + /// \since 1.0 + /// + inline bool isWeakDefined() const noexcept { + return (_flags & SymbolFlags::WeakDefined) == SymbolFlags::WeakDefined; + } + + /// + /// \brief Query if the symbol is weak referenced. + /// \return True if the symbol is weak referenced, false otherwise. + /// \since 1.0 + /// + inline bool isWeakReferenced() const noexcept { + return (_flags & SymbolFlags::WeakReferenced) == + SymbolFlags::WeakReferenced; + } + +private: + SymbolKind _kind; + std::string _name; + SymbolFlags _flags; +}; + +TAPI_NAMESPACE_V1_END + +/// +/// @} +/// + +#endif // TAPI_SYMBOL_H diff --git a/tapilite/include/tapi/Version.h b/tapilite/include/tapi/Version.h new file mode 100644 index 00000000..6fcbda43 --- /dev/null +++ b/tapilite/include/tapi/Version.h @@ -0,0 +1,63 @@ +//===-- tapi/Version.h - TAPI Version Interface -----------------*- C++ -*-===*\ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Access the TAPI version information. +/// \since 1.0 +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#ifndef TAPI_VERSION_H +#define TAPI_VERSION_H + +#include +#include + +/// +/// \defgroup TAPI_VERSION Version methods +/// \ingroup TAPI_CPP_API +/// +/// @{ +/// + +namespace tapi { + +/// +/// \brief Access to version related information about the TAPI dynamic library. +/// \since 1.0 +/// +class TAPI_PUBLIC Version { +public: + /// + /// \name Version Number Methods + /// @{ + /// + + /// + /// \brief Get the full library name and version as string. + /// \return A string with the program name and version number. + /// \since 1.0 + /// + static std::string getFullVersionAsString() noexcept; + + /// + /// @} + /// +}; + +} // namespace tapi + +/// +/// @} +/// + +#endif // TAPI_VERSION_H diff --git a/tapilite/include/tapi/tapi.h b/tapilite/include/tapi/tapi.h new file mode 100644 index 00000000..6cc2fd6e --- /dev/null +++ b/tapilite/include/tapi/tapi.h @@ -0,0 +1,34 @@ +//===-- tapi/tapi.h - TAPI C++ Library Interface ----------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief This is the umbrella header for the TAPI C++ Library Interface. +/// \since 1.0 +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#ifndef TAPI_H +#define TAPI_H + +/// +/// \defgroup TAPI_CPP_API TAPI C++ API +/// +/// The C++ Application Programming Interface (API) for the TAPI library +/// + +#include +#include +#include +#include +#include + +#endif // TAPI_H diff --git a/tapilite/src/CMakeLists.txt b/tapilite/src/CMakeLists.txt new file mode 100644 index 00000000..d8c83eec --- /dev/null +++ b/tapilite/src/CMakeLists.txt @@ -0,0 +1,12 @@ + +set(TAPILITE_SOURCES + LinkerInterfaceFile.cpp + Version.cpp +) + +add_library(tapilite STATIC ${TAPILITE_SOURCES}) + +include_directories("${CMAKE_SOURCE_DIR}/tapilite/include") +include_directories("${CMAKE_SOURCE_DIR}/ld64/src/abstraction") +# for configure.h +include_directories("${CMAKE_BINARY_DIR}/ld64") diff --git a/tapilite/src/LinkerInterfaceFile.cpp b/tapilite/src/LinkerInterfaceFile.cpp new file mode 100644 index 00000000..d579a129 --- /dev/null +++ b/tapilite/src/LinkerInterfaceFile.cpp @@ -0,0 +1,1087 @@ +//===- libtapi/LinkerInterfaceFile.cpp - TAPI File Interface ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Implements the C++ linker interface file API. +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +TAPI_NAMESPACE_V1_BEGIN + +//using namespace tapi::internal; + +static PackedVersion32 parseVersion32(std::string str) { + size_t len = 0; + uint32_t version = 0; + size_t num = 0; + + if (str.empty()) + return 0; + + len = str.find_first_of("."); + if (len == std::string::npos) + return 0; + + num = std::stoull(str, &len, 10); + if (len == 0) + return 0; + + if (num > UINT16_MAX) + return 0; + + version = num << 16; + str = str.substr(len + 1); + + len = str.find_first_of("."); + if (len != std::string::npos) { + num = std::stoull(str, &len, 10); + if (len == 0) + return 0; + + if (num > UINT8_MAX) + return 0; + + version |= (num << 8); + str = str.substr(len + 1); + } + + if (!str.empty()) { + num = std::stoull(str, &len, 10); + if (len == 0) + return 0; + + if (num > UINT8_MAX) + return 0; + + version |= num; + } + + return version; +} + +class LinkerInterfaceFile::ImplData { +public: + std::string _path; + FileType _fileType{FileType::Unsupported}; + Platform _platform{Platform::Unknown}; + std::string _installName; + + PackedVersion32 _currentVersion; + PackedVersion32 _compatibilityVersion; + unsigned _swiftABIVersion; + ObjCConstraint _objcConstraint; + + std::vector _reexportedLibraries; + std::vector _allowableClients; + std::vector _exports; + std::vector _undefineds; + + std::vector _arches; + std::string _selectedArch; + + LinkerInterfaceFile::ImplData *next; + + ImplData() noexcept = default; + + static LinkerInterfaceFile::ImplData * + loadFile(const std::string &path, const uint8_t *data, size_t size, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, + std::string &errorMessage); +}; + +class LinkerInterfaceFile::Impl { +public: + std::shared_ptr _data; + + std::string _installName; + std::string _parentFrameworkName; + PackedVersion32 _compatibilityVersion; + std::vector _ignoreExports; + std::vector _inlinedFrameworkNames; + std::vector _exports; + std::vector _undefineds; + + bool _hasTwoLevelNamespace{false}; + bool _isAppExtensionSafe{false}; + bool _hasWeakDefExports{false}; + bool _installPathOverride{false}; + + Impl() noexcept = default; + + bool init(const std::shared_ptr &data, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, ParsingFlags flags, + PackedVersion32 minOSVersion, std::string &errorMessage) noexcept; + + template void addSymbol(T &&name, SymbolFlags flags) { + if (std::find(_ignoreExports.begin(), _ignoreExports.end(), + name) == _ignoreExports.end()) + _exports.emplace_back(std::forward(name), flags); + } + + void processSymbol(std::string name, PackedVersion32 minOSVersion, + bool disallowWeakImports) { + // $ld$ $ $ + if (name.substr(0, sizeof("$ld$") - 1).compare("$ld$") != 0) + return; + + name = name.substr(sizeof("$ld$") - 1); + + size_t pos = name.find_first_of("$"); + if (pos == std::string::npos) + return; + auto action = name.substr(0, pos); + name = name.substr(pos + 1); + + pos = name.find_first_of("$"); + if (pos == std::string::npos) + return; + auto condition = name.substr(0, pos); + name = name.substr(pos + 1); + + if (name.empty()) + return; + auto symbolName = name; + + if (condition.substr(0, sizeof("os") - 1).compare("os") != 0) + return; + + auto version = parseVersion32(condition.substr(sizeof("os") - 1)); + if (version != minOSVersion) + return; + + if (action.compare("hide") == 0) { + _ignoreExports.emplace_back(symbolName); + return; + } + + if (action.compare("add") == 0) { + _exports.emplace_back(symbolName); + return; + } + + if (action.compare("weak") == 0) { + if (disallowWeakImports) + _ignoreExports.emplace_back(symbolName); + + return; + } + + if (action.compare("install_name") == 0) { + _installName = symbolName; + _installPathOverride = true; + if (_installName == "/System/Library/Frameworks/" + "ApplicationServices.framework/Versions/A/" + "ApplicationServices") { + _compatibilityVersion = parseVersion32("1.0"); + } + return; + } + + if (action.compare("compatibility_version") == 0) { + _compatibilityVersion = parseVersion32(symbolName); + return; + } + } +}; + +static std::string getArchForCPU(cpu_type_t cpuType, cpu_subtype_t cpuSubType, + bool enforceCpuSubType) { + /* this function is deliberately stupid, for the fine details of + * subtypes we need more checking, which isn't necessary for the + * general case */ + + switch (cpuType) { + case CPU_TYPE_I386: + return "i386"; + case CPU_TYPE_X86_64: + return "x86_64"; + case CPU_TYPE_ARM: + return "arm"; + case CPU_TYPE_POWERPC: + return "ppc"; + case CPU_TYPE_POWERPC64: + return "ppc64"; + case CPU_TYPE_ARM64: + return "arm64"; + case CPU_TYPE_ANY: + return ""; /* meant to match first arch */ + default: + return "unsupported"; + } +} + +LinkerInterfaceFile::LinkerInterfaceFile() noexcept + : _pImpl{new LinkerInterfaceFile::Impl} {} +LinkerInterfaceFile::~LinkerInterfaceFile() noexcept = default; +LinkerInterfaceFile::LinkerInterfaceFile(LinkerInterfaceFile &&) noexcept = + default; +LinkerInterfaceFile & +LinkerInterfaceFile::operator=(LinkerInterfaceFile &&) noexcept = default; + +std::vector +LinkerInterfaceFile::getSupportedFileExtensions() noexcept { + return {".tbd"}; +} + + +/// \brief Load and parse the provided TBD file in the buffer and return on +/// success the interface file. +LinkerInterfaceFile::ImplData *LinkerInterfaceFile::ImplData::loadFile( + const std::string &path, const uint8_t *data, size_t size, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, + std::string &errorMessage) { + yaml_parser_t parser; + yaml_event_t event; + yaml_char_t *p; + bool selectSection = false; + bool inList = false; + + LinkerInterfaceFile::ImplData *ret = nullptr; + LinkerInterfaceFile::ImplData *cur = nullptr; + + /* Because platform isn't passed onto us by ld, we cannot know what to + * select -- this is probably the problem meant to be solved by TAPIv4 + * which explicitly refers to targets such that arm64-macos is + * different from arm64-ios. Alas, for now it seems this mix isn't + * there for (system) tbd files, so we just ignore platform, and + * return the first one that matches the cpu specification. */ + std::string myarch = getArchForCPU(cpuType, cpuSubType, false); + + enum { + TAPILITE_INIT, + TAPILITE_HEADER, + TAPILITE_EXPORTS, + TAPILITE_UNDEFINEDS, + TAPILITE_REEXPORTS, + TAPILITE_DONE + } state = TAPILITE_INIT; + enum { + TAPILITE_FINDKEY, + TAPILITE_ARCHS, + TAPILITE_UUIDS, + TAPILITE_PLATFORM, + TAPILITE_FLAGS, + TAPILITE_INSTALLNAME, + TAPILITE_CURVERSION, + TAPILITE_COMPATVERSION, + TAPILITE_SWIFTVERSION, + TAPILITE_OBJCCONSTR, + TAPILITE_PARENTUMBR, + TAPILITE_ALLOWED_CLNTS, + TAPILITE_SYMBOLS, + TAPILITE_RE_EXPORTS, + TAPILITE_OBJCCLASSES, + TAPILITE_OBJCEHTYPES, + TAPILITE_OBJCIVARS, + TAPILITE_WEAKDEFSYMS, + TAPILITE_THRLOCSYMS, + TAPILITE_VERSION + } substate = TAPILITE_FINDKEY; + enum { + TAPILITE_V_INVALID, + TAPILITE_V1, + TAPILITE_V2, + TAPILITE_V3, + TAPILITE_V4_OR_LATER, + TAPILITE_V4 + } version = TAPILITE_V1; /* default for tagless */ + + yaml_parser_initialize(&parser); + yaml_parser_set_input_string(&parser, + reinterpret_cast(data), size); + +#define error(...) { \ + char errbuf[256]; \ + snprintf(errbuf, sizeof(errbuf), __VA_ARGS__); \ + errorMessage = errbuf; \ + return nullptr; \ +} +#ifdef tapilite_debug +# define dprintf(...) printf(__VA_ARGS) +#else +# define dprintf(...) +#endif + /* syntax: + * https://github.com/apple/llvm-project/blob/apple/main/llvm/lib/TextAPI/MachO/TextStub.cpp */ + while (state != TAPILITE_DONE) { + if (state != TAPILITE_INIT) + yaml_event_delete(&event); + else + state = TAPILITE_HEADER; + + if (!yaml_parser_parse(&parser, &event)) + break; + + dprintf("yaml: %d\n", event.type); +#define ymlcmp(X, Y) strcmp((char *)X, Y) +#define ymlncmp(X, Y, Z) strncmp((char *)X, Y, Z) + /* process */ + switch (event.type) { + case YAML_DOCUMENT_START_EVENT: + if (cur == nullptr) { + ret = cur = new LinkerInterfaceFile::ImplData; + } else { + cur = cur->next = new LinkerInterfaceFile::ImplData; + } + cur->_path = path; + cur->next = nullptr; + break; + case YAML_STREAM_END_EVENT: + state = TAPILITE_DONE; + break; + case YAML_SCALAR_EVENT: +#define yamlscalar event.data.scalar + if (yamlscalar.value != NULL && substate == TAPILITE_FINDKEY) { + switch (state) { + case TAPILITE_HEADER: + dprintf("header| key: %s\n", yamlscalar.value); + if (ymlcmp(yamlscalar.value, "archs") == 0) + substate = TAPILITE_ARCHS; + if (ymlcmp(yamlscalar.value, "targets") == 0) + substate = TAPILITE_ARCHS; + else if (ymlcmp(yamlscalar.value, "platform") == 0) + substate = TAPILITE_PLATFORM; + else if (ymlcmp(yamlscalar.value, "install-name") == 0) + substate = TAPILITE_INSTALLNAME; + else if (ymlcmp(yamlscalar.value, "current-version") == 0) + substate = TAPILITE_CURVERSION; + else if (ymlcmp(yamlscalar.value, "compatibility-version") == 0) + substate = TAPILITE_COMPATVERSION; + else if (ymlcmp(yamlscalar.value, "swift-version") == 0) + substate = TAPILITE_SWIFTVERSION; + else if (ymlcmp(yamlscalar.value, "swift-abi-version") == 0) + substate = TAPILITE_SWIFTVERSION; + else if (ymlcmp(yamlscalar.value, "objc-constraint") == 0) + substate = TAPILITE_OBJCCONSTR; + else if (ymlcmp(yamlscalar.value, "uuids") == 0) + substate = TAPILITE_UUIDS; + else if (ymlcmp(yamlscalar.value, "parent-umbrella") == 0) + substate = TAPILITE_PARENTUMBR; + else if (ymlcmp(yamlscalar.value, "allowable-clients") == 0) + substate = TAPILITE_ALLOWED_CLNTS; + else if (ymlcmp(yamlscalar.value, "flags") == 0) + substate = TAPILITE_FLAGS; + else if (ymlcmp(yamlscalar.value, "tbd-version") == 0) + substate = TAPILITE_VERSION; + else if (ymlcmp(yamlscalar.value, "exports") == 0) + state = TAPILITE_EXPORTS; + else if (ymlcmp(yamlscalar.value, "reexported-libraries") == 0) + state = TAPILITE_REEXPORTS; + else if (ymlcmp(yamlscalar.value, "undefineds") == 0) + state = TAPILITE_UNDEFINEDS; + break; + case TAPILITE_EXPORTS: + case TAPILITE_REEXPORTS: + dprintf("exports| key: %s\n", yamlscalar.value); + if (ymlcmp(yamlscalar.value, "archs") == 0) + substate = TAPILITE_ARCHS; + if (ymlcmp(yamlscalar.value, "targets") == 0) + substate = TAPILITE_ARCHS; + else if (ymlcmp(yamlscalar.value, "allowed-clients") == 0) + substate = TAPILITE_ALLOWED_CLNTS; + else if (ymlcmp(yamlscalar.value, "re-exports") == 0) + substate = TAPILITE_RE_EXPORTS; + else if (ymlcmp(yamlscalar.value, "libraries") == 0) + substate = TAPILITE_RE_EXPORTS; + else if (ymlcmp(yamlscalar.value, "symbols") == 0) + substate = TAPILITE_SYMBOLS; + else if (ymlcmp(yamlscalar.value, "objc-classes") == 0) + substate = TAPILITE_OBJCCLASSES; + else if (ymlcmp(yamlscalar.value, "objc-eh-types") == 0) + substate = TAPILITE_OBJCEHTYPES; + else if (ymlcmp(yamlscalar.value, "objc-ivars") == 0) + substate = TAPILITE_OBJCIVARS; + else if (ymlcmp(yamlscalar.value, "weak-def-symbols") == 0) + substate = TAPILITE_WEAKDEFSYMS; + else if (ymlcmp(yamlscalar.value, "weak-symbols") == 0) + substate = TAPILITE_WEAKDEFSYMS; + else if (ymlcmp(yamlscalar.value, "thread-local-symbols") == 0) + substate = TAPILITE_THRLOCSYMS; + break; + case TAPILITE_UNDEFINEDS: + if (ymlcmp(yamlscalar.value, "archs") == 0) + substate = TAPILITE_ARCHS; + if (ymlcmp(yamlscalar.value, "targets") == 0) + substate = TAPILITE_ARCHS; + else if (ymlcmp(yamlscalar.value, "symbols") == 0) + substate = TAPILITE_SYMBOLS; + else if (ymlcmp(yamlscalar.value, "objc-classes") == 0) + substate = TAPILITE_OBJCCLASSES; + else if (ymlcmp(yamlscalar.value, "objc-eh-types") == 0) + substate = TAPILITE_OBJCEHTYPES; + else if (ymlcmp(yamlscalar.value, "objc-ivars") == 0) + substate = TAPILITE_OBJCIVARS; + else if (ymlcmp(yamlscalar.value, "weak-ref-symbols") == 0) + substate = TAPILITE_WEAKDEFSYMS; + else if (ymlcmp(yamlscalar.value, "weak-symbols") == 0) + substate = TAPILITE_WEAKDEFSYMS; + break; + } + + /* reset selection selector */ + if (substate == TAPILITE_ARCHS) + selectSection = false; + } else if (substate != TAPILITE_FINDKEY) { + /* we have a real value, need to append it to whatever is + * currently the open thing we're writing for */ + switch (state) { + case TAPILITE_HEADER: + dprintf("header|%d val: %s\n", substate, yamlscalar.value); + switch (substate) { + case TAPILITE_VERSION: + if (version == TAPILITE_V4_OR_LATER) { + if (ymlcmp(yamlscalar.value, "4") == 0) + version = TAPILITE_V4; + else + error("unsupported TAPI version %s", yamlscalar.value); + } else { + error("found tbd-version for TAPI version _fileType == FileType::Unsupported) { + /* apply defaults for various settings based on the + * TAPI version */ + switch (version) { + case TAPILITE_V1: + cur->_currentVersion = parseVersion32("1.0"); + cur->_compatibilityVersion = parseVersion32("1.0"); + cur->_swiftABIVersion = 0; + cur->_objcConstraint = ObjCConstraint::None; + break; + case TAPILITE_V2: + case TAPILITE_V3: + case TAPILITE_V4: + cur->_currentVersion = parseVersion32("1.0"); + cur->_compatibilityVersion = parseVersion32("1.0"); + cur->_swiftABIVersion = 0; + cur->_objcConstraint = ObjCConstraint::Retain_Release; + break; + } + + if (version == TAPILITE_V1) + cur->_fileType = FileType::TBD_V1; + else if (version == TAPILITE_V2) + cur->_fileType = FileType::TBD_V2; + else if (version == TAPILITE_V3) + cur->_fileType = FileType::TBD_V3; + else if (version == TAPILITE_V4) + cur->_fileType = FileType::TBD_V4; + } + + cur->_arches.emplace_back( + std::string((const char *)yamlscalar.value)); + if (!cur->_selectedArch.empty()) + break; /* take first matching arch */ + + switch (version) { + case TAPILITE_V4: + { + /* extract arch, platform out of target, set + * platform if arch matches */ + size_t len = myarch.length(); + if (ymlncmp(yamlscalar.value, myarch.c_str(), len) == 0 + && (len == 0 || yamlscalar.value[len] == '-')) + { + const char *p = (const char *)yamlscalar.value; + cur->_selectedArch = std::string(p); + if (len == 0) + len = cur->_selectedArch.find_first_of('-'); + /* this almost is a copy of the PLATFORM case below */ + if (cur->_selectedArch. + substr(len + 1).compare("macos") == 0) + cur->_platform = Platform::OSX; + else if (cur->_selectedArch. + substr(len + 1).compare("ios") == 0) + cur->_platform = Platform::iOS; + /* TODO: see below */ + } + } + break; + default: + if (myarch.empty()) { + cur->_selectedArch = + std::string((const char *)yamlscalar.value); + } else { + /* see if arch matches */ + if (ymlcmp(yamlscalar.value, myarch.c_str())) + cur->_selectedArch = myarch; + } + break; + } + break; + case TAPILITE_PLATFORM: + if (ymlcmp(yamlscalar.value, "macosx") == 0) + cur->_platform = Platform::OSX; + else if (ymlcmp(yamlscalar.value, "ios") == 0) + cur->_platform = Platform::iOS; + /* TODO: does it really make a difference to check for + * the rest? */ + break; + case TAPILITE_INSTALLNAME: + cur->_installName = + std::string((const char *)yamlscalar.value); + break; + case TAPILITE_CURVERSION: + cur->_currentVersion = + parseVersion32((const char *)yamlscalar.value); + break; + case TAPILITE_COMPATVERSION: + cur->_compatibilityVersion = + parseVersion32((const char *)yamlscalar.value); + break; + case TAPILITE_SWIFTVERSION: + cur->_swiftABIVersion = + std::stoull((const char *)yamlscalar.value, NULL, 10); + break; + case TAPILITE_OBJCCONSTR: + if (ymlcmp(yamlscalar.value, "none") == 0) + cur->_objcConstraint = ObjCConstraint::None; + else if (ymlcmp(yamlscalar.value, "retain_release") == 0) + cur->_objcConstraint = ObjCConstraint::Retain_Release; + else if (ymlcmp(yamlscalar.value, + "retain_release_for_simulator") == 0) + cur->_objcConstraint = + ObjCConstraint::Retain_Release_For_Simulator; + else if (ymlcmp(yamlscalar.value, + "retain_release_or_gc") == 0) + cur->_objcConstraint = + ObjCConstraint::Retain_Release_Or_GC; + else if (ymlcmp(yamlscalar.value, "gc") == 0) + cur->_objcConstraint = ObjCConstraint::GC; + break; + case TAPILITE_ALLOWED_CLNTS: + cur->_allowableClients.emplace_back( + std::string((const char *)yamlscalar.value)); + break; + case TAPILITE_UUIDS: + case TAPILITE_PARENTUMBR: + case TAPILITE_FLAGS: + /* ignored: there's currently no consumer for it from + * ld64 */ + break; + } + break; + case TAPILITE_EXPORTS: + case TAPILITE_REEXPORTS: + dprintf("exports|%d val: %s\n", substate, yamlscalar.value); + switch (substate) { + case TAPILITE_ARCHS: + /* remember: for V4, we store target in selectedArch */ + if (ymlcmp(yamlscalar.value, cur->_selectedArch.c_str()) == 0) + selectSection = true; + break; + case TAPILITE_ALLOWED_CLNTS: + /* should respect this, but for now we just ignore it */ + break; + case TAPILITE_RE_EXPORTS: + if (!selectSection) + break; + cur->_reexportedLibraries.emplace_back( + std::string((const char *)yamlscalar.value)); + break; + case TAPILITE_SYMBOLS: + if (!selectSection) + break; + cur->_exports.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, SymbolKind::GlobalSymbol)); + break; + case TAPILITE_OBJCCLASSES: + if (!selectSection) + break; + cur->_exports.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, SymbolKind::ObjectiveCClass)); + break; + case TAPILITE_OBJCEHTYPES: + if (!selectSection) + break; + cur->_exports.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, SymbolKind::ObjectiveCClassEHType)); + break; + case TAPILITE_OBJCIVARS: + if (!selectSection) + break; + cur->_exports.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, + SymbolKind::ObjectiveCInstanceVariable)); + break; + case TAPILITE_WEAKDEFSYMS: + if (!selectSection) + break; + cur->_exports.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::WeakDefined, SymbolKind::GlobalSymbol)); + break; + case TAPILITE_THRLOCSYMS: + if (!selectSection) + break; + cur->_exports.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::ThreadLocalValue, SymbolKind::GlobalSymbol)); + break; + } + break; + case TAPILITE_UNDEFINEDS: + switch (substate) { + case TAPILITE_ARCHS: + /* remember: for V4, we store target in selectedArch */ + if (ymlcmp(yamlscalar.value, cur->_selectedArch.c_str()) == 0) + selectSection = true; + break; + case TAPILITE_SYMBOLS: + if (!selectSection) + break; + cur->_undefineds.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, SymbolKind::GlobalSymbol)); + break; + case TAPILITE_OBJCCLASSES: + if (!selectSection) + break; + cur->_undefineds.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, SymbolKind::ObjectiveCClass)); + break; + case TAPILITE_OBJCEHTYPES: + if (!selectSection) + break; + cur->_undefineds.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, SymbolKind::ObjectiveCClassEHType)); + break; + case TAPILITE_OBJCIVARS: + if (!selectSection) + break; + cur->_undefineds.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::None, + SymbolKind::ObjectiveCInstanceVariable)); + break; + case TAPILITE_WEAKDEFSYMS: + if (!selectSection) + break; + cur->_undefineds.emplace_back(new Symbol( + std::string((const char *)yamlscalar.value), + SymbolFlags::WeakReferenced, SymbolKind::GlobalSymbol)); + break; + } + break; + } + if (!inList) + substate = TAPILITE_FINDKEY; + } + break; + case YAML_SEQUENCE_START_EVENT: + inList = true; + break; + case YAML_SEQUENCE_END_EVENT: + substate = TAPILITE_FINDKEY; + inList = false; + break; + case YAML_MAPPING_START_EVENT: +#define yamlms event.data.mapping_start + switch (state) { + case TAPILITE_HEADER: + if (yamlms.tag == NULL) + break; + if (ymlncmp(yamlms.tag, "!tapi-tbd", + sizeof("!tapi-tbd") - 1) != 0) + break; + p = yamlms.tag + sizeof("!tapi-tbd") - 1; + if (*p == '\0') { + /* this could be version 4 or later, in which case we + * expect a tbd-version key */ + version = TAPILITE_V4_OR_LATER; + } else if (*p == '-' && p[1] == 'v') { + p += 2; + switch (*p) { + case '1': + /* technically shouldn't be in use */ + version = TAPILITE_V1; + break; + case '2': + version = TAPILITE_V2; + break; + case '3': + version = TAPILITE_V3; + break; + default: + version = TAPILITE_V_INVALID; + break; + } + } + break; + default: + /* ignore */ + break; + } + substate = TAPILITE_FINDKEY; + inList = false; + break; + case YAML_MAPPING_END_EVENT: + inList = false; + /* TODO: could use this to close list pointers or something */ + break; + default: + break; + } + } + + yaml_event_delete(&event); + yaml_parser_delete(&parser); +#undef error + + return ret; +} + +bool LinkerInterfaceFile::isSupported(const std::string &path, + const uint8_t *data, + size_t size) noexcept { + std::string err; + auto file = LinkerInterfaceFile::ImplData::loadFile( + path, data, size, CPU_TYPE_ANY, CPU_SUBTYPE_MULTIPLE, err); + + return file && file->_platform != Platform::Unknown; +} + +bool LinkerInterfaceFile::shouldPreferTextBasedStubFile( + const std::string &path) noexcept { + // Never prefer this, if a dylib exists, take it because it will be + // more reliable than this "lite" stub, see also below + return false; +} + +bool LinkerInterfaceFile::areEquivalent(const std::string &tbdPath, + const std::string &dylibPath) noexcept { + // Simple decision, always prefer dylib over textstub if it exists, + // don't check anything, so we don't have to implement Mach-O reading + // to check that UUIDs match + return false; +} + +bool LinkerInterfaceFile::Impl::init( + const std::shared_ptr &data, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, ParsingFlags flags, + PackedVersion32 minOSVersion, std::string &errorMessage) noexcept { + _data = data; + bool enforceCpuSubType = flags & ParsingFlags::ExactCpuSubType; + auto arch = getArchForCPU(cpuType, cpuSubType, enforceCpuSubType); + if (arch.compare("unsupported") == 0) { + auto count = data->_arches.size(); + if (count > 1) + errorMessage = "missing required architecture " + + arch + " in file " + + data->_path + " (" + std::to_string(count) + + " slices)"; + else + errorMessage = "missing required architecture " + + arch + " in file " + + data->_path; + return false; + } + + _compatibilityVersion = data->_compatibilityVersion; + _installName = data->_installName; + + // Remove the patch level. + minOSVersion = + PackedVersion32(minOSVersion.getMajor(), minOSVersion.getMinor(), 0); + + // Pre-scan for special linker symbols. + for (auto *symbol : _data->_exports) { + if (symbol->getKind() != SymbolKind::GlobalSymbol) + continue; + + processSymbol(symbol->getName(), minOSVersion, + flags & ParsingFlags::DisallowWeakImports); + } + std::sort(_ignoreExports.begin(), _ignoreExports.end()); + auto last = std::unique(_ignoreExports.begin(), _ignoreExports.end()); + _ignoreExports.erase(last, _ignoreExports.end()); + + bool useObjC1ABI = + (data->_platform == Platform::OSX) && (arch.compare("i386") == 0); + for (const auto *symbol : data->_exports) { + switch (symbol->getKind()) { + case SymbolKind::GlobalSymbol: + if (symbol->getName().substr(0, 4).compare("$ld$") == 0) + continue; + addSymbol(symbol->getName(), symbol->getFlags()); + break; + case SymbolKind::ObjectiveCClass: + if (useObjC1ABI) { + addSymbol(".objc_class_name_" + symbol->getName(), + symbol->getFlags()); + } else { + addSymbol("_OBJC_CLASS_$_" + symbol->getName(), + symbol->getFlags()); + addSymbol("_OBJC_METACLASS_$_" + symbol->getName(), + symbol->getFlags()); + } + break; + case SymbolKind::ObjectiveCClassEHType: + addSymbol("_OBJC_EHTYPE_$_" + symbol->getName(), + symbol->getFlags()); + break; + case SymbolKind::ObjectiveCInstanceVariable: + addSymbol("_OBJC_IVAR_$_" + symbol->getName(), symbol->getFlags()); + break; + } + + if (symbol->isWeakDefined()) + _hasWeakDefExports = true; + } + + for (const auto *symbol : data->_undefineds) { + switch (symbol->getKind()) { + case SymbolKind::GlobalSymbol: + _undefineds.emplace_back(symbol->getName(), symbol->getFlags()); + break; + case SymbolKind::ObjectiveCClass: + if (useObjC1ABI) { + _undefineds.emplace_back(".objc_class_name_" + symbol->getName(), + symbol->getFlags()); + } else { + _undefineds.emplace_back("_OBJC_CLASS_$_" + symbol->getName(), + symbol->getFlags()); + _undefineds.emplace_back("_OBJC_METACLASS_$_" + symbol->getName(), + symbol->getFlags()); + } + break; + case SymbolKind::ObjectiveCClassEHType: + _undefineds.emplace_back("_OBJC_EHTYPE_$_" + symbol->getName(), + symbol->getFlags()); + break; + case SymbolKind::ObjectiveCInstanceVariable: + _undefineds.emplace_back("_OBJC_IVAR_$_" + symbol->getName(), + symbol->getFlags()); + break; + } + } + + for (auto *file = data->next; file != nullptr; file = file->next) + _inlinedFrameworkNames.emplace_back(file->_installName); + + return true; +} + +LinkerInterfaceFile *LinkerInterfaceFile::create( + const std::string &path, const uint8_t *data, size_t size, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, + CpuSubTypeMatching matchingMode, PackedVersion32 minOSVersion, + std::string &errorMessage) noexcept { + + ParsingFlags flags = (matchingMode == CpuSubTypeMatching::Exact) + ? ParsingFlags::ExactCpuSubType + : ParsingFlags::None; + + return create(path, data, size, cpuType, cpuSubType, flags, minOSVersion, + errorMessage); +} + +LinkerInterfaceFile *LinkerInterfaceFile::create( + const std::string &path, const uint8_t *data, size_t size, + cpu_type_t cpuType, cpu_subtype_t cpuSubType, ParsingFlags flags, + PackedVersion32 minOSVersion, std::string &errorMessage) noexcept { + + if (path.empty() || data == nullptr || size < 8) { + errorMessage = "invalid argument"; + return nullptr; + } + + auto impldata = LinkerInterfaceFile::ImplData::loadFile( + path, data, size, cpuType, cpuSubType, errorMessage); + if (impldata == nullptr) + return nullptr; + + auto file = new LinkerInterfaceFile; + if (file == nullptr) { + errorMessage = "could not allocate memory"; + return nullptr; + } + + if (file->_pImpl->init( + std::shared_ptr(impldata), + cpuType, cpuSubType, flags, minOSVersion, errorMessage)) { + return file; + } + + delete file; + return nullptr; +} + +LinkerInterfaceFile * +LinkerInterfaceFile::create(const std::string &path, cpu_type_t cpuType, + cpu_subtype_t cpuSubType, ParsingFlags flags, + PackedVersion32 minOSVersion, + std::string &errorMessage) noexcept { + std::ifstream ifs; + ifs.open(path, std::ifstream::in); + auto buf = std::string(std::istreambuf_iterator{ifs}, {}); + auto data = LinkerInterfaceFile::ImplData::loadFile( + path, (const uint8_t *)buf.c_str(), buf.length(), + cpuType, cpuSubType, errorMessage); + if (data == nullptr) + return nullptr; + + auto file = new LinkerInterfaceFile; + if (file == nullptr) { + errorMessage = "could not allocate memory"; + return nullptr; + } + + if (file->_pImpl->init( + std::shared_ptr(data), + cpuType, cpuSubType, flags, minOSVersion, errorMessage)) { + return file; + } + + delete file; + return nullptr; +} + +FileType LinkerInterfaceFile::getFileType() const noexcept { + return _pImpl->_data->_fileType; +} + +Platform LinkerInterfaceFile::getPlatform() const noexcept { + return _pImpl->_data->_platform; +} + +const std::string &LinkerInterfaceFile::getInstallName() const noexcept { + return _pImpl->_installName; +} + +bool LinkerInterfaceFile::isInstallNameVersionSpecific() const noexcept { + return _pImpl->_installPathOverride; +} + +PackedVersion32 LinkerInterfaceFile::getCurrentVersion() const noexcept { + return _pImpl->_data->_currentVersion; +} + +PackedVersion32 LinkerInterfaceFile::getCompatibilityVersion() const noexcept { + return _pImpl->_compatibilityVersion; +} + +unsigned LinkerInterfaceFile::getSwiftVersion() const noexcept { + return _pImpl->_data->_swiftABIVersion; +} + +ObjCConstraint LinkerInterfaceFile::getObjCConstraint() const noexcept { + return _pImpl->_data->_objcConstraint; +} + +bool LinkerInterfaceFile::hasTwoLevelNamespace() const noexcept { + return _pImpl->_hasTwoLevelNamespace; +} + +bool LinkerInterfaceFile::isApplicationExtensionSafe() const noexcept { + return _pImpl->_isAppExtensionSafe; +} + +bool LinkerInterfaceFile::hasAllowableClients() const noexcept { + return !_pImpl->_data->_allowableClients.empty(); +} + +bool LinkerInterfaceFile::hasReexportedLibraries() const noexcept { + return !_pImpl->_data->_reexportedLibraries.empty(); +} + +bool LinkerInterfaceFile::hasWeakDefinedExports() const noexcept { + return _pImpl->_hasWeakDefExports; +} + +const std::string &LinkerInterfaceFile::getParentFrameworkName() const + noexcept { + return _pImpl->_parentFrameworkName; +} + +const std::vector &LinkerInterfaceFile::allowableClients() const + noexcept { + return _pImpl->_data->_allowableClients; +} + +const std::vector &LinkerInterfaceFile::reexportedLibraries() const + noexcept { + return _pImpl->_data->_reexportedLibraries; +} + +const std::vector &LinkerInterfaceFile::ignoreExports() const + noexcept { + return _pImpl->_ignoreExports; +} + +const std::vector &LinkerInterfaceFile::exports() const noexcept { + return _pImpl->_exports; +} + +const std::vector &LinkerInterfaceFile::undefineds() const noexcept { + return _pImpl->_undefineds; +} + +const std::vector & +LinkerInterfaceFile::inlinedFrameworkNames() const noexcept { + return _pImpl->_inlinedFrameworkNames; +} + +LinkerInterfaceFile *LinkerInterfaceFile::getInlinedFramework( + const std::string &installName, cpu_type_t cpuType, + cpu_subtype_t cpuSubType, ParsingFlags flags, PackedVersion32 minOSVersion, + std::string &errorMessage) const noexcept { + + for (auto *it = _pImpl->_data->next; it != nullptr; it = it->next) { + if (it->_installName.compare(installName) != 0) + continue; + + auto file = new LinkerInterfaceFile; + if (file == nullptr) { + errorMessage = "could not allocate memory"; + return nullptr; + } + + if (file->_pImpl->init( + std::shared_ptr(it), + cpuType, cpuSubType, flags, minOSVersion, errorMessage)) { + return file; + } + } + + errorMessage = "no such inlined framework"; + return nullptr; +} + +TAPI_NAMESPACE_V1_END + +/* vim:set ts=2 sw=2 expandtab: */ diff --git a/tapilite/src/Version.cpp b/tapilite/src/Version.cpp new file mode 100644 index 00000000..6ae2c26e --- /dev/null +++ b/tapilite/src/Version.cpp @@ -0,0 +1,48 @@ +//===- libtapi/Version.cpp - TAPI Version Interface -------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Implements the C++ version interface. +/// +//===----------------------------------------------------------------------===// +// +// Modified version for "tapilite", a standalone just enough +// implementation for use without LLVM +// +#include +#include + +/// \brief Helper macro for TAPI_VERSION_STRING. +#define TAPI_MAKE_STRING2(X) #X + +/// \brief A string that describes the TAPI version number, e.g., "1.0.0". +#define TAPI_MAKE_STRING(X) TAPI_MAKE_STRING2(X) + +namespace tapi { + +std::string Version::getFullVersionAsString() noexcept { + std::string result; +#ifdef TAPI_VENDOR + result += TAPI_VENDOR; +#endif +#ifdef TAPI_VERSION + result += TAPI_MAKE_STRING(TAPI_VERSION); +#endif + result += " based on Apple TAPI"; +#ifdef APPLE_VERSION + result += " version " APPLE_VERSION; +#endif +#ifdef TAPI_REPOSITORY_STRING + result += " (" TAPI_REPOSITORY_STRING ")"; +#endif + + return result; +} + +} // end namespace tapi.