bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maintainer checks for non-c89 constructs?


From: deckrider
Subject: Re: Maintainer checks for non-c89 constructs?
Date: Sat, 9 Jun 2007 06:21:45 -0600

Perhaps DISTCHECK_CONFIGURE_FLAGS, conditionally defined in your top
level Makefile.am will do the trick?

You can use AM_CONDITIONAL in your configure.ac driven by testing that
$GCC equals yes.

On 6/9/07, James Youngman <address@hidden> wrote:
I maintain findutils on a GNU/Linux system using GCC.  Findutils uses
gnulib to provide a number of portability features, and also
extensions not in c89 such as "bool".   With the help of gnulib, some
non-c89 things are available on c89-based systems.

However, gnulib cannot make the compiler look like a c99 compiler
because for example a c89 compiler would correctly reject this:

int
foo (void)
{
  int x = 2;
  printf ("hello\n");
  int y = 3;   /* problem here */
  /* ... */
  return 0;
}

GCC accepts this construct because it is (or can be) a c99 compiler.
I find that about twice a year someone submits a bug report because
I've accidentally used a non-c89 construct without noticing.   Is
there any way I can use Automake to help me avoid this?

For example, is there any way to get "make distcheck" to try, where
possible, to compile in c89 mode if the compiler is GCC?   There are a
number of other flags and combinations which might be useful.

Thanks,
James.





--
ASCII ribbon campaign:
()  against HTML email
/\  against Microsoft attachments
   Information:  http://www.expita.com/nomime.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]