← Back to team overview

maria-developers team mailing list archive

Re: 19fbfab084f: Compilation fix

 

Hi Sergei!

On Wed, Sep 1, 2021 at 3:46 PM Sergei Golubchik <serg@xxxxxxxxxxx> wrote:
>
> Hi, Aleksey!
>
> On Sep 01, Aleksey Midenkov wrote:
> > revision-id: 19fbfab084f (mariadb-10.6.1-67-g19fbfab084f)
> > parent(s): 8009680fbc3
> > author: Aleksey Midenkov
> > committer: Aleksey Midenkov
> > timestamp: 2021-08-30 22:02:40 +0300
> > message:
> >
> > Compilation fix
> >
> > diff --git a/sql/sql_table.h b/sql/sql_table.h
> > index 83e88c82f0e..8cb9ebe0445 100644
> > --- a/sql/sql_table.h
> > +++ b/sql/sql_table.h
> > @@ -20,8 +20,14 @@
> >  #include <my_sys.h>                             // pthread_mutex_t
> >  #include "m_string.h"                           // LEX_CUSTRING
> >
> > +inline bool suicide()
> > +{
> > +  DBUG_SUICIDE();
> > +  return false;
> > +}
> > +
> >  #define ERROR_INJECT_CRASH(code) \
> > -  (DBUG_IF(code) && (DBUG_SUICIDE(), 0))
> > +  (DBUG_IF(code) && suicide())
>
> What did that change? A compiler didn't like (void,0) ?

Here

#define DBUG_SUICIDE()                  do { } while(0)

DBUG_SUICIDE is not an expression. It's a statement and cannot be used
in expression.

>
> Regards,
> Sergei
> VP of MariaDB Server Engineering
> and security@xxxxxxxxxxx



-- 
All the best,

Aleksey Midenkov
@midenok


Follow ups

References