[GRASS-dev] compilation of grass on AIX 7.1

Glynn Clements glynn at gclements.plus.com
Wed Apr 3 01:06:35 PDT 2013


Markus Neteler wrote:

> > It appears that AIX uses something other than _POSIX_C_SOURCE to
> > enable the POSIX declarations (which -ansi will disable).
> 
> Any concrete POSIX declaration which I should hunt down?

off_t would be a good start.

> > The question is: what does it use?
> >
> > If we don't have anyone who is able and willing to put in the
> > (relatively minor) effort to figure that out, then AIX "support" (for
> > any reasonable definition of that term) is impractical. Even if we can
> > get it to compile, even quite trivial run-time problems will be
> > insurmountable.
> 
> I am willing to do this. Just I have to better understand *what* to look for.

I suspect that _ALL_SOURCE is the one which will cause the most
problems, as that appears to enable declarations which aren't part of
any standard.

The issue is how to disable that without also disabling Unix
functionality. Using -ansi (or -std=c89 etc) normally results in
standard headers (stdio.h etc) providing only those declarations which
are mandated by the C standard, and not those which are added by POSIX
or other Unix standards.

I suspect that the <standards.h> header may be central to the setting
of the macros which enable sets of features corresponding to various C
and Unix standards.

One thing which can help is to create an empty .c file then use e.g.:

	gcc -ansi -E -dM empty.c | sort > macros.h

This will generate a list of the macros which are predefined by gcc.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list