develooper Front page | perl.perl5.porters | Postings from October 2003

Re: assert.h breaks perl.h

Thread Previous | Thread Next
From:
Alexey Tourbin
Date:
October 17, 2003 03:55
Subject:
Re: assert.h breaks perl.h
Message ID:
20031017105503.GI1724@julia.office.altlinux.ru
On Thu, Oct 16, 2003 at 09:22:24PM +0100, Nicholas Clark wrote:
> >  #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
> > -#define assert_not_ROK(sv)	({assert(!SvROK(sv) || !SvRV(sv))}),
> > +#define assert_not_ROK(sv)	({assert(!SvROK(sv) || !SvRV(sv));}),
> >  #else
> >  #define assert_not_ROK(sv)	
> >  #endif
> 
> I think that I wrote this code originally, and if so I tested it on gcc,
> probably either 2.95 or 3.2 (Or at least I thought that I did)
> Do you know why I didn't encounter an error? Has gcc changed, or did I
> screw up in some way?

This is probably beacuse without <assert.h> it expands to
({})
which is still valid, but with <assert.h> included it expands to
({assert_expression})
and semicolon is required then.

> Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About