Print

Print


Hi Gerri,

OK, I understand now. No problem. Thanks for correcting it.

Andy

On Sun, 29 Aug 2004, Gerardo Ganis  wrote:

> *** Discussion title: xrootd development and discussion
> Email replies to [log in to unmask] must include:
>   In-Reply-To: <[log in to unmask]>
>   Subject: ...change this to be about your reply.
>
>    Hi Andy,
>
> > OK, I see it now. That's way too many files hit for me to absorb. I guess
> > I don't understand why the massive change. Theoriginal setup was
> > *supposed* to prevent the expansion of the macro if NODEBUG was set and
> > that shouldn't have caused any compiler problems. So, I don't understand
> > the change at all, I guess.
> >
> > Gerri what was the actual problem?
>
>   When compiling with -DNODEBUG there were basically 3 situations giving errors
>   or warnings:
>
>     1) undefined TRACE_xxx symbols
>        These were defined only for !defined(NODEBUG), but there are cases in
>        which they still get compiled, though not used.
>        An empty definition would not have been enough, so I moved the whole
>        definition out the conditional statement (by looking at the code it
>        seems to me that this should not harm; alternatively we should put
>        some default value ... 0x0 ? ).
>
>        Files:
>
>        src/Xrd/XrdTrace.hh
>        src/XrdOdc/XrdOdcTrace.hh
>        src/XrdOlb/XrdOlbTrace.hh
>        src/XrdOss/XrdOssTrace.hh
>        src/XrdXr/XrdXrTrace.hh
>        src/XrdXrootd/XrdXrootdTrace.hh
>
>     2) Incomplete or wrong definition of some macros: for example in
>        XrdOdc/XrdOdcTrace.hh, there was this
>
> #ifndef NODEBUG
>   ...
> #define DEBUG(y) if (QTRACE(Debug)) \
>                     {OdcTrace.Beg(epname); cerr <<y; OdcTrace.End();}
> #else
>   ...
> #define DEBUG(x,y)
> #endif
>
>         and the compiler was complaining about the number of arguments
>         to DEBUG; there were a few of these.
>         A variant of this problem was (eg src/XrdXrootd/XrdXrootdTrace.hh)
>
> #ifndef NODEBUG
>   ...
> #define TRACING(x) XrdXrootdTrace->What & x
> #else
>   ...
> #define TRACING(x)
> #endif
>
>         with -DNODEBUG this ends up in code like  ' if() ' which gives
>         an error.
>
>      3) Lot of warnings from non used 'const char *epname ="..."' variables.
>         For this I have introduced a macro EPNAME
>
> #ifndef NODEBUG
> #define EPNAME(x) const char *epname = x;
> #else
> #define EPNAME(x)
> #endif
>
>         to avoid having 'ifndef' at each occurence.
>
>         As you see nothing serious, but many small things.
>
>      Gerri
>
>