Re: [PATCH:macros 2/2] Make XORG_STRICT_OPTION always set STRICT_CFLAGS

2011-04-28 Thread Gaetan Nadon
On Wed, 2011-04-27 at 19:13 -0700, Dan Nicholson wrote:

 On Wed, Apr 27, 2011 at 5:32 PM, Alan Coopersmith
 alan.coopersm...@oracle.com wrote:
  On 04/27/11 03:54 AM, Dan Nicholson wrote:
  IMO, you should at least AC_SUBST the variable if you want to use it
  somewhere else.
 
  I just wanted to make it available to the XORG_TLS macro Jeremy's working
  on, not in a Makefile - is AC_SUBST needed for that?
 
  On the other hand it doesn't hurt, so I can easily add it anyway.
 
 My thinking is that it's odd to depend on an internal variable of
 another macro. AC_SUBST doesn't change anything, but at least it's
 being announced. I'm just being pedantic, though.
 

I agree. By virtue of usage, AC_SUBST has acquired a public
declaration role.
The value is stored in config.status and config.log which helps
debugging.



 --
 Dan
 ___
 xorg-devel@lists.x.org: X.Org development
 Archives: http://lists.x.org/archives/xorg-devel
 Info: http://lists.x.org/mailman/listinfo/xorg-devel


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:macros 2/2] Make XORG_STRICT_OPTION always set STRICT_CFLAGS

2011-04-27 Thread Dan Nicholson
On Mon, Apr 25, 2011 at 8:35 PM, Alan Coopersmith
alan.coopersm...@oracle.com wrote:
 Still only adds it to CWARNFLAGS if --enable-strict-compilation is
 passed, but sets the variable with the right flags for the compiler
 so it's available for other checks in configure scripts.

 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
 ---
  xorg-macros.m4.in |   16 
  1 files changed, 8 insertions(+), 8 deletions(-)

 diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
 index bdf734e..367b75a 100644
 --- a/xorg-macros.m4.in
 +++ b/xorg-macros.m4.in
 @@ -1348,16 +1348,16 @@ AC_ARG_ENABLE(strict-compilation,
                          AS_HELP_STRING([--enable-strict-compilation],
                          [Enable all warnings from compiler and make them 
 errors (default: disabled)]),
                          [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
 +if test x$GCC = xyes ; then
 +    STRICT_CFLAGS=-pedantic -Werror
 +elif test x$SUNCC = xyes; then
 +    STRICT_CFLAGS=-errwarn
 +elif test x$INTELCC = xyes; then
 +    STRICT_CFLAGS=-Werror
 +fi
  if test x$STRICT_COMPILE = xyes; then
 -       if test x$GCC = xyes ; then
 -               STRICT_CFLAGS=-pedantic -Werror
 -       elif test x$SUNCC = xyes; then
 -               STRICT_CFLAGS=-errwarn
 -       elif test x$INTELCC = xyes; then
 -               STRICT_CFLAGS=-Werror
 -       fi
 +    CWARNFLAGS=$CWARNFLAGS $STRICT_CFLAGS
  fi
 -CWARNFLAGS=$CWARNFLAGS $STRICT_CFLAGS
  AC_SUBST([CWARNFLAGS])
  ]) # XORG_STRICT_OPTION

IMO, you should at least AC_SUBST the variable if you want to use it
somewhere else.

--
Dan
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:macros 2/2] Make XORG_STRICT_OPTION always set STRICT_CFLAGS

2011-04-27 Thread Jeremy Huddleston
Actually, I think you should do this for gcc since it doesn't automatically 
error on unknown attributes (then I can pull that into the xorg-tls macro):

STRICT_CFLAGS=-pedantic -Werror -Werror=attributes


On Apr 27, 2011, at 3:54 AM, Dan Nicholson wrote:

 On Mon, Apr 25, 2011 at 8:35 PM, Alan Coopersmith
 alan.coopersm...@oracle.com wrote:
 Still only adds it to CWARNFLAGS if --enable-strict-compilation is
 passed, but sets the variable with the right flags for the compiler
 so it's available for other checks in configure scripts.
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
 ---
  xorg-macros.m4.in |   16 
  1 files changed, 8 insertions(+), 8 deletions(-)
 
 diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
 index bdf734e..367b75a 100644
 --- a/xorg-macros.m4.in
 +++ b/xorg-macros.m4.in
 @@ -1348,16 +1348,16 @@ AC_ARG_ENABLE(strict-compilation,
  AS_HELP_STRING([--enable-strict-compilation],
  [Enable all warnings from compiler and make them 
 errors (default: disabled)]),
  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
 +if test x$GCC = xyes ; then
 +STRICT_CFLAGS=-pedantic -Werror
 +elif test x$SUNCC = xyes; then
 +STRICT_CFLAGS=-errwarn
 +elif test x$INTELCC = xyes; then
 +STRICT_CFLAGS=-Werror
 +fi
  if test x$STRICT_COMPILE = xyes; then
 -   if test x$GCC = xyes ; then
 -   STRICT_CFLAGS=-pedantic -Werror
 -   elif test x$SUNCC = xyes; then
 -   STRICT_CFLAGS=-errwarn
 -   elif test x$INTELCC = xyes; then
 -   STRICT_CFLAGS=-Werror
 -   fi
 +CWARNFLAGS=$CWARNFLAGS $STRICT_CFLAGS
  fi
 -CWARNFLAGS=$CWARNFLAGS $STRICT_CFLAGS
  AC_SUBST([CWARNFLAGS])
  ]) # XORG_STRICT_OPTION
 
 IMO, you should at least AC_SUBST the variable if you want to use it
 somewhere else.
 
 --
 Dan
 ___
 xorg-devel@lists.x.org: X.Org development
 Archives: http://lists.x.org/archives/xorg-devel
 Info: http://lists.x.org/mailman/listinfo/xorg-devel

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH:macros 2/2] Make XORG_STRICT_OPTION always set STRICT_CFLAGS

2011-04-27 Thread Alan Coopersmith
On 04/27/11 03:54 AM, Dan Nicholson wrote:
 IMO, you should at least AC_SUBST the variable if you want to use it
 somewhere else.

I just wanted to make it available to the XORG_TLS macro Jeremy's working
on, not in a Makefile - is AC_SUBST needed for that?

On the other hand it doesn't hurt, so I can easily add it anyway.

-- 
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH:macros 2/2] Make XORG_STRICT_OPTION always set STRICT_CFLAGS

2011-04-27 Thread Dan Nicholson
On Wed, Apr 27, 2011 at 5:32 PM, Alan Coopersmith
alan.coopersm...@oracle.com wrote:
 On 04/27/11 03:54 AM, Dan Nicholson wrote:
 IMO, you should at least AC_SUBST the variable if you want to use it
 somewhere else.

 I just wanted to make it available to the XORG_TLS macro Jeremy's working
 on, not in a Makefile - is AC_SUBST needed for that?

 On the other hand it doesn't hurt, so I can easily add it anyway.

My thinking is that it's odd to depend on an internal variable of
another macro. AC_SUBST doesn't change anything, but at least it's
being announced. I'm just being pedantic, though.

--
Dan
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH:macros 2/2] Make XORG_STRICT_OPTION always set STRICT_CFLAGS

2011-04-26 Thread Gaetan Nadon
On Mon, 2011-04-25 at 20:35 -0700, Alan Coopersmith wrote:

 Still only adds it to CWARNFLAGS if --enable-strict-compilation is
 passed, but sets the variable with the right flags for the compiler
 so it's available for other checks in configure scripts.
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
 

Reviewed-by: Gaetan Nadon mems...@videotron.ca


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel