Re: svn commit: r40377 - trunk/subversion/libsvn_ra_serf

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: svn commit: r40377 - trunk/subversion/libsvn_ra_serf

by Daniel Shahaf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul T. Burba wrote on Wed, 4 Nov 2009 at 19:26 -0800:

> Author: pburba
> Date: Wed Nov  4 19:26:27 2009
> New Revision: 40377
>
> Log:
> Follow-up to r38105, fix some diabolical ra_serf failures in the merge tests.
>
> * subversion/libsvn_ra_serf/util.c
>   (svn_ra_serf__handle_xml_parser): Do not depend on order of evaluation
>   of the arguments in the call to svn_error_compose_create() since this is
>   not defined by the C standard

This bitten us a few times already.  Perhaps we could add a macro that
forces the right order?  Or enable a compiler warning for this?

e.g.,

#define svn_error_compose_create2(errvar1, errvar2, expr1, expr2) \
    (errvar1 = (expr1), errvar2 = (expr2),                        \
     svn_error_compose_create(errvar1, errvar2))

#define svn_error_compose_create2(errvar, expr1, expr2)    \
  do {                                                     \
    svn_error_t __err1 = (expr1);                          \
    svn_error_t __err2 = (expr2);                          \
    errvar = svn_error_compose_create(__err1, __err2);     \
  } while (0)

???

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2414888

Re: svn commit: r40377 - trunk/subversion/libsvn_ra_serf

by Paul Burba-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 5, 2009 at 2:22 PM, Daniel Shahaf <d.s@...> wrote:

> Paul T. Burba wrote on Wed, 4 Nov 2009 at 19:26 -0800:
>> Author: pburba
>> Date: Wed Nov  4 19:26:27 2009
>> New Revision: 40377
>>
>> Log:
>> Follow-up to r38105, fix some diabolical ra_serf failures in the merge tests.
>>
>> * subversion/libsvn_ra_serf/util.c
>>   (svn_ra_serf__handle_xml_parser): Do not depend on order of evaluation
>>   of the arguments in the call to svn_error_compose_create() since this is
>>   not defined by the C standard
>
> This bitten us a few times already.

Hi Daniel,

I hadn't realized that, do you recall where (this is really just for
my own curiosity)?

> Perhaps we could add a macro that
> forces the right order?  Or enable a compiler warning for this?
>
> e.g.,
>
> #define svn_error_compose_create2(errvar1, errvar2, expr1, expr2) \
>    (errvar1 = (expr1), errvar2 = (expr2),                        \
>     svn_error_compose_create(errvar1, errvar2))
>
> #define svn_error_compose_create2(errvar, expr1, expr2)    \
>  do {                                                     \
>    svn_error_t __err1 = (expr1);                          \
>    svn_error_t __err2 = (expr2);                          \
>    errvar = svn_error_compose_create(__err1, __err2);     \
>  } while (0)

Maybe...but isn't any argument list to any function that depends on
the evaluation order of those arguments just as likely to be a
problem?

Paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415106

Re: svn commit: r40377 - trunk/subversion/libsvn_ra_serf

by Daniel Shahaf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul Burba wrote on Fri, 6 Nov 2009 at 09:31 -0500:

> On Thu, Nov 5, 2009 at 2:22 PM, Daniel Shahaf <d.s@...> wrote:
> > Paul T. Burba wrote on Wed, 4 Nov 2009 at 19:26 -0800:
> >> Author: pburba
> >> Date: Wed Nov  4 19:26:27 2009
> >> New Revision: 40377
> >>
> >> Log:
> >> Follow-up to r38105, fix some diabolical ra_serf failures in the merge tests.
> >>
> >> * subversion/libsvn_ra_serf/util.c
> >>   (svn_ra_serf__handle_xml_parser): Do not depend on order of evaluation
> >>   of the arguments in the call to svn_error_compose_create() since this is
> >>   not defined by the C standard
> >
> > This bitten us a few times already.
>
> Hi Daniel,
>
> I hadn't realized that, do you recall where (this is really just for
> my own curiosity)?
>
In a switch() somewhere?  I looked now but can't find it.

> > Perhaps we could add a macro that
> > forces the right order?  Or enable a compiler warning for this?
> >
> > e.g.,
> >
> > #define svn_error_compose_create2(errvar1, errvar2, expr1, expr2) \
> >    (errvar1 = (expr1), errvar2 = (expr2),                        \
> >     svn_error_compose_create(errvar1, errvar2))
> >
> > #define svn_error_compose_create2(errvar, expr1, expr2)    \
> >  do {                                                     \
> >    svn_error_t __err1 = (expr1);                          \
> >    svn_error_t __err2 = (expr2);                          \
> >    errvar = svn_error_compose_create(__err1, __err2);     \
> >  } while (0)
>
> Maybe...but isn't any argument list to any function that depends on
> the evaluation order of those arguments just as likely to be a
> problem?
>
Of course.  But I don't think we've seen this problem except with
svn_error_compose_create().

> Paul
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415106
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415212