From: Andreas Tobler Date: Sun, 6 Jul 2008 20:28:30 +0000 (+0000) Subject: configure.ac: Check for caddr_t, define to char * if not defined. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bba09b5aaca1e4ebaeccb827233b1b4299cbf859;p=gcc.git configure.ac: Check for caddr_t, define to char * if not defined. 2008-07-06 Andreas Tobler * configure.ac: Check for caddr_t, define to char * if not defined. * configure: Regenerate. * ggc-common.c (mmap_gt_pch_get_address): Fix -Wc++-compat warnings. (mmap_gt_pch_use_address): Likewise. * config/host-solaris.c (sol_gt_pch_use_address): Likewise. From-SVN: r137538 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3dd4618a0b9..a3f6462f029 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2008-07-06 Andreas Tobler + + * configure.ac: Check for caddr_t, define to char * if not defined. + * configure: Regenerate. + * ggc-common.c (mmap_gt_pch_get_address): Fix -Wc++-compat warnings. + (mmap_gt_pch_use_address): Likewise. + * config/host-solaris.c (sol_gt_pch_use_address): Likewise. + 2008-07-06 Richard Guenther * tree-ssa-structalias.c (struct variable_info): Remove has_union. diff --git a/gcc/config/host-solaris.c b/gcc/config/host-solaris.c index 9a471b49f4c..bde01db9813 100644 --- a/gcc/config/host-solaris.c +++ b/gcc/config/host-solaris.c @@ -42,7 +42,7 @@ sol_gt_pch_use_address (void *base, size_t size, int fd, size_t offset) if (size == 0) return -1; - addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, + addr = mmap ((caddr_t) base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, offset); /* Solaris isn't good about honoring the mmap START parameter @@ -55,18 +55,18 @@ sol_gt_pch_use_address (void *base, size_t size, int fd, size_t offset) size_t i; if (addr != (void *) MAP_FAILED) - munmap (addr, size); + munmap ((caddr_t) addr, size); errno = 0; for (i = 0; i < size; i += page_size) - if (mincore ((char *)base + i, page_size, (void *)&one_byte) == -1 + if (mincore ((char *)base + i, page_size, (char *) &one_byte) == -1 && errno == ENOMEM) continue; /* The page is not mapped. */ else break; if (i >= size) - addr = mmap (base, size, + addr = mmap ((caddr_t) base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, offset); } diff --git a/gcc/configure b/gcc/configure index f2b15d192e7..5d2ceb5308a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -10326,6 +10326,72 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for caddr_t" >&5 +echo $ECHO_N "checking for caddr_t... $ECHO_C" >&6 +if test "${ac_cv_type_caddr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((caddr_t *) 0) + return 0; +if (sizeof (caddr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_caddr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_caddr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_caddr_t" >&5 +echo "${ECHO_T}$ac_cv_type_caddr_t" >&6 +if test $ac_cv_type_caddr_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define caddr_t char * +_ACEOF + +fi + # Try to determine the array type of the second argument of getgroups # for the target system (int or gid_t). @@ -14659,13 +14725,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:14662: $ac_compile\"" >&5) + (eval echo "\"\$as_me:14728: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:14665: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:14731: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:14668: output\"" >&5) + (eval echo "\"\$as_me:14734: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -15720,7 +15786,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 15723 "configure"' > conftest.$ac_ext + echo '#line 15789 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -16340,11 +16406,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16343: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16409: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16347: \$? = $ac_status" >&5 + echo "$as_me:16413: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16662,11 +16728,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16665: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16731: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16669: \$? = $ac_status" >&5 + echo "$as_me:16735: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16767,11 +16833,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16770: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16836: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16774: \$? = $ac_status" >&5 + echo "$as_me:16840: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16822,11 +16888,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16825: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16891: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16829: \$? = $ac_status" >&5 + echo "$as_me:16895: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19619,7 +19685,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19622 "configure" +#line 19688 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19719,7 +19785,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19722 "configure" +#line 19788 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 31b448720a2..1e9e8d87b78 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1010,6 +1010,7 @@ int main() fi AC_CHECK_TYPE(ssize_t, int) +AC_CHECK_TYPE(caddr_t, char *) # Try to determine the array type of the second argument of getgroups # for the target system (int or gid_t). diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index d1022a1da85..8c0e459fe38 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -638,7 +638,7 @@ mmap_gt_pch_get_address (size_t size, int fd) if (ret == (void *) MAP_FAILED) ret = NULL; else - munmap (ret, size); + munmap ((caddr_t) ret, size); return ret; } @@ -662,7 +662,7 @@ mmap_gt_pch_use_address (void *base, size_t size, int fd, size_t offset) if (size == 0) return -1; - addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, + addr = mmap ((caddr_t) base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, offset); return addr == base ? 1 : -1;