Re: [Patch] Fix obsolete autoconf macros in configure.ac
On Thu, 2014-04-24 at 10:23 +0200, Richard Biener wrote: > >> > +AC_CHECK_TYPES([ssize_t]) > >> > +AC_CHECK_TYPES([caddr_t]) > > > > But I am not sure what header file this code would go in. > > In system.h. > > > Steve Ellcey FYI: I ran into problems defining ssize_t and caddr_t in system.h because it was causing more typedef conflicts during the build. I have come up with a new fix for my mingw build problem and submitted that new patch to gcc-patches. http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01577.html Steve Ellcey sell...@mips.com
Re: [Patch] Fix obsolete autoconf macros in configure.ac
On Wed, Apr 23, 2014 at 8:05 PM, Steve Ellcey wrote: > On Wed, 2014-04-23 at 18:40 +0200, Andreas Schwab wrote: >> "Steve Ellcey " writes: >> >> > diff --git a/gcc/configure.ac b/gcc/configure.ac >> > index d789557..98acb1b 100644 >> > --- a/gcc/configure.ac >> > +++ b/gcc/configure.ac >> > @@ -1083,8 +1083,8 @@ int main() >> >fi >> > fi >> > >> > -AC_CHECK_TYPE(ssize_t, int) >> > -AC_CHECK_TYPE(caddr_t, char *) >> > +AC_CHECK_TYPES([ssize_t]) >> > +AC_CHECK_TYPES([caddr_t]) >> >> You also need to handle the no longer supported default definition. >> Moreover, the two macro calls can be combined into one. >> >> Andreas. > > OK, if I keep these definitions, where would I put the default > definitions? I assume I want this in configure.ac: > > AC_CHECK_TYPES([ssize_t, caddr_t]) > > and then something like this in a header file: > > #ifndef HAVE_SSIZE_T > typedef int ssize_t; > #endif > #ifndef HAVE_CADDR_T > typedef char *caddr_t; > #endif > > But I am not sure what header file this code would go in. In system.h. > Steve Ellcey >
Re: [Patch] Fix obsolete autoconf macros in configure.ac
On Wed, 2014-04-23 at 18:40 +0200, Andreas Schwab wrote: > "Steve Ellcey " writes: > > > diff --git a/gcc/configure.ac b/gcc/configure.ac > > index d789557..98acb1b 100644 > > --- a/gcc/configure.ac > > +++ b/gcc/configure.ac > > @@ -1083,8 +1083,8 @@ int main() > >fi > > fi > > > > -AC_CHECK_TYPE(ssize_t, int) > > -AC_CHECK_TYPE(caddr_t, char *) > > +AC_CHECK_TYPES([ssize_t]) > > +AC_CHECK_TYPES([caddr_t]) > > You also need to handle the no longer supported default definition. > Moreover, the two macro calls can be combined into one. > > Andreas. OK, if I keep these definitions, where would I put the default definitions? I assume I want this in configure.ac: AC_CHECK_TYPES([ssize_t, caddr_t]) and then something like this in a header file: #ifndef HAVE_SSIZE_T typedef int ssize_t; #endif #ifndef HAVE_CADDR_T typedef char *caddr_t; #endif But I am not sure what header file this code would go in. Steve Ellcey
Re: [Patch] Fix obsolete autoconf macros in configure.ac
Steve Ellcey writes: > Actually, now that I look more at caddr_t, I see that we probably > shouldn't be using it at all. The only uses in the gcc subdirectory are > for calls to mmap and munmap (in gcc.c, gcc-common.c, and > config/host-solaris.c) and the latest definitions for mmap and munmap > say it should use 'void *', not caddr_t. I will submit a new This may be irrelevant: Solaris (and other OSes) regularly provide different compilation environments for various levels of standards compatibility, and the default is not the latest. Even apart from Solaris, not everyone adheres to yesterday's version of POSIX.1. > patch to remove the uses (and definition) of caddr_t from gcc. Please be very careful here; this easily break several ports. Rainer -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: [Patch] Fix obsolete autoconf macros in configure.ac
On Wed, 2014-04-23 at 18:40 +0200, Andreas Schwab wrote: > "Steve Ellcey " writes: > > > diff --git a/gcc/configure.ac b/gcc/configure.ac > > index d789557..98acb1b 100644 > > --- a/gcc/configure.ac > > +++ b/gcc/configure.ac > > @@ -1083,8 +1083,8 @@ int main() > >fi > > fi > > > > -AC_CHECK_TYPE(ssize_t, int) > > -AC_CHECK_TYPE(caddr_t, char *) > > +AC_CHECK_TYPES([ssize_t]) > > +AC_CHECK_TYPES([caddr_t]) > > You also need to handle the no longer supported default definition. > Moreover, the two macro calls can be combined into one. > > Andreas. Actually, now that I look more at caddr_t, I see that we probably shouldn't be using it at all. The only uses in the gcc subdirectory are for calls to mmap and munmap (in gcc.c, gcc-common.c, and config/host-solaris.c) and the latest definitions for mmap and munmap say it should use 'void *', not caddr_t. I will submit a new patch to remove the uses (and definition) of caddr_t from gcc. ssize_t should probably still be fixed, but that was not causing me a failure and it can be handled separately. Steve Ellcey sell...@mips.com
Re: [Patch] Fix obsolete autoconf macros in configure.ac
"Steve Ellcey " writes: > diff --git a/gcc/configure.ac b/gcc/configure.ac > index d789557..98acb1b 100644 > --- a/gcc/configure.ac > +++ b/gcc/configure.ac > @@ -1083,8 +1083,8 @@ int main() >fi > fi > > -AC_CHECK_TYPE(ssize_t, int) > -AC_CHECK_TYPE(caddr_t, char *) > +AC_CHECK_TYPES([ssize_t]) > +AC_CHECK_TYPES([caddr_t]) You also need to handle the no longer supported default definition. Moreover, the two macro calls can be combined into one. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
[Patch] Fix obsolete autoconf macros in configure.ac
The gcc configure.ac script is using an obsolete form of the AC_CHECK_TYPE autoconf macro to check for caddr_t and ssize_t. http://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/Obsolete-Macros.html#Obsolete-Macros This usage is causing a build failure for me when building a windows GCC using the mingw toolset. I would like to replace the obsolete autoconf macros with a 'proper' one. Tested with my mingw build and a MIPS targetted linux build. OK to checkin? Steve Ellcey sell...@mips.com 2014-04-23 Steve Ellcey * configure.ac (caddr_t, ssize_t): Use AC_CHECK_TYPES instead of obsolete form of AC_CHECK_TYPE. * configure: Regenerate. diff --git a/gcc/configure.ac b/gcc/configure.ac index d789557..98acb1b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1083,8 +1083,8 @@ int main() fi fi -AC_CHECK_TYPE(ssize_t, int) -AC_CHECK_TYPE(caddr_t, char *) +AC_CHECK_TYPES([ssize_t]) +AC_CHECK_TYPES([caddr_t]) GCC_AC_FUNC_MMAP_BLACKLIST