This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch gfortran]: Fix warning for w64 reasoned by pointer cast


On Wed, 12 Aug 2009, Tobias Burnus wrote:

> "__PTRDIFF_TYPE__
>  [...]
>  These macros are defined to the correct underlying types for the [...]
>  ptrdiff_t typedefs, respectively. They exist to make the standard header
>  files [...] stdint.h [...] work correctly. You should not use these macros
>  directly; instead, include the appropriate headers and use the typedefs.
>  Some of these macros may not be defined on particular systems if GCC does
>  not provide a stdint.h header on those systems."
> 
> I wonder whether the last item is a problem for some systems. A grep in
> GCC shows e.g. in libgfortran/ChangeLog-2003:
> 	* io/read.c: Don't use stdint.h, it doesn't exist on cygwin.
> but 2003 was 6 years ago. And using the macro directly does not make one
> rely on the existance of stdint.h itself.

The macros such as __INTPTR_TYPE__ are only defined where the type 
information has been built into GCC.  We still need the maintainers of 
support for NetBSD, OpenBSD, VxWorks, alpha*-dec-osf[45]*, VMS, SymbianOS, 
WinCE, DJGPP, LynxOS, Netware, QNX, Interix, IRIX and s390x-ibm-tpf* to 
add the information for their OSes; see 
<http://gcc.gnu.org/ml/gcc/2009-07/msg00625.html>.

If you wish to use these macros unconditionally in a runtime library, I 
suggest identifying which of those OSes may support building that library 
in GCC and finding people (with assignments on file, whether or not 
formally maintainers for those OS ports) who have contributed patches to 
GCC or other toolchain components related to those OSes and getting them 
to add the stdint.h information, or proposing OS ports for deprecation in 
the absence of maintainers.  (Any OSes whose ports already don't support 
Fortran can be ignored for the purposes of using features in the Fortran 
library.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]