[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha-dev
Subject:    Re: [Linux-ha-dev] heartbeat build fails on IA64
From:       Xun Sun <xun.sun.cn () gmail ! com>
Date:       2005-11-12 14:19:18
Message-ID: 83c4b03b0511120619p6ae9a418r5583d31c981b4f30 () mail ! gmail ! com
[Download RAW message or body]

On 11/12/05, Alan Robertson <alanr@unix.sh> wrote:
> Xun Sun wrote:
> > Hi Lars,
> >
> > On 11/10/05, Lars Marowsky-Bree <lmb@suse.de> wrote:
> >> On 2005-10-31T11:31:52, Xun Sun <xun.sun.cn@gmail.com> wrote:
> >>
> >>> Hello,
> >>> Is this problem still worth investigating? I am not going to make a
> >>> patch if nobody will need it :)
> >> Yes, the problem still exists. If you could send your patch, that would
> >> be helpful.
> >>
> >
> > I have come up with the attached patch, could you please check if it
> > fixes your problem?
> >
> > This tries to compile the unused_return_result_test.c twice, with the
> > only difference being whether we get the return code of fwrite(). If
> > and only if the first fails and second succeeds, we know that we
> > should do something with the conf_lex.l file.
> >
> > This diff file was not generated by diff directly, but I cat'ted 3
> > independent diff files together to get it. Thus don't be surprised if
> > it can not apply cleanly...
> >
> >> Another alternative would be to post-process the generated code. ;-)
> >>
> >>
> >> Sincerely,
> >>     Lars Marowsky-Brée <lmb@suse.de>
> >>
> >> --
> >> High Availability & Clustering
> >> SUSE Labs, Research and Development
> >> SUSE LINUX Products GmbH - A Novell Business     -- Charles Darwin
> >> "Ignorance more frequently begets confidence than does knowledge"
> >>
> >> _______________________________________________________
> >> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> >> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> >> Home Page: http://linux-ha.org/
> >>
> >
> >
> > --
> > Thanks & regards
> > Xun Sun
> >
> >
> > ------------------------------------------------------------------------
> >
> > --- linux-ha.orig/configure.in        2005-11-12 02:00:34.120487232 +0800
> > +++ linux-ha/configure.in     2005-11-12 01:39:20.178155904 +0800
> > @@ -1647,9 +1647,33 @@
> >       ANSI="-ansi -D_GNU_SOURCE -DANSI_ONLY"
> >       fi
> >
> > -     if test "${enable_fatal_warnings}" = yes && cc_supports_flag -Werror ; then
> > -          echo "Enabling Fatal Warnings (-Werror) on this platform"
> > -       FATAL_WARNINGS="-Werror"
> > +     if cc_supports_flag -Werror ; then
> > +       if test "${enable_fatal_warnings}" = yes; then
> > +             echo "Enabling Fatal Warnings (-Werror) on this platform"
> > +             FATAL_WARNINGS="-Werror"
> > +       fi
> > +
> > +       AC_MSG_CHECKING(whether fwrite() is declared with warn_unused_result attribute)
> > +
> > +       ac_save_CFLAGS=$CFLAGS
> > +       CFLAGS="-Werror"
> > +       AC_COMPILE_IFELSE(`cat $srcdir/config/unused_return_result_test.c`, [rc=0], [rc=1])
> > +       if test "$rc" = 1; then
> > +             CFLAGS="-DUSE_RETURNED_RESULT $CFLAGS"
> > +             AC_COMPILE_IFELSE(`cat $srcdir/config/unused_return_result_test.c`, [rc=0], [rc=1])
> > +             if test "$rc" = 0; then
> > +                     AC_MSG_RESULT(yes)
> > +                     AC_DEFINE(USE_RETURNED_RESULT, 1, [define to 1 if some of the library \
> > +                     functions we call are declared with warn_unused_result attribute])
> > +             else
> > +                     AC_MSG_RESULT(no)
> > +             fi
> > +       else
> > +             AC_MSG_RESULT(no)
> > +       fi
> > +
> > +       CFLAGS=$ac_save_CFLAGS
> > +
> >          fi
> >
> >       if test "$enable_traditional_warning" = yes && \
> > --- linux-ha.orig/telecom/recoverymgrd/conf_lex.l     2005-08-03 22:33:16.000000000 +0800
> > +++ linux-ha/telecom/recoverymgrd/conf_lex.l  2005-11-12 01:39:35.069892016 +0800
> > @@ -40,6 +40,10 @@
> >  #    define  MAKE_WARNINGS_GO_AWAY   ;
> >  #endif
> >
> > +#ifdef USE_RETURNED_RESULT
> > +     size_t rc;
> > +#    define ECHO rc=fwrite( yytext, yyleng, 1, yyout)
> > +#endif
> >  %}
> >
> >  %{
> > --- linux-ha.orig/config/unused_return_result_test.c  2005-11-12 02:15:12.228994448 +0800
> > +++ linux-ha/config/unused_return_result_test.c       2005-11-12 00:58:49.520672008 +0800
> > @@ -0,0 +1,11 @@
> > +#include <stdio.h>
> > +int main(int argc, char **argv)
> > +{
> > +#ifdef USE_RETURN_RESULT
> > +     size_t rc;
> > +     rc = fwrite("unused", 7, 1, stdout);
> > +#else
> > +     fwrite("unused", 7, 1, stdout);
>
> How about this much simpler patch?
>
> diff -u -r1.8 conf_lex.l
> --- conf_lex.l  3 Aug 2005 14:33:16 -0000       1.8
> +++ conf_lex.l  11 Nov 2005 23:34:43 -0000
> @@ -20,6 +20,7 @@
>
>   #undef _GNU_SOURCE  /* in case it was defined on the command line */
>   #define _GNU_SOURCE /* Needed for strn* functions */
> +#define ECHO {int fwrc = fwrite( yytext, yyleng, 1, yyout ); if (fwrc
> != yyleng) { fprintf(stderr, "Fwrite failure [%d]\n", fwrc);};}
>

It is much simpler and more straightforward, hence better than mine. I
have no objection.

>
>
> --
>      Alan Robertson <alanr@unix.sh>
>
> "Openness is the foundation and preservative of friendship...  Let me
> claim from you at all times your undisguised opinions." - William
> Wilberforce
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>


--
Thanks & regards
Xun Sun
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic