From: Jarkko Hietaniemi Date: Tue, 11 Mar 2003 18:15:45 +0000 (+0000) Subject: The 0, in the assert_not_ROK() makes IRIX cc to worry X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=54866b45ebf2e61ddf59cf6687e39cd07dc514b0;p=p5sagit%2Fp5-mst-13.2.git The 0, in the assert_not_ROK() makes IRIX cc to worry (cc-1171 cc: WARNING ... The indicated expression has no effect.) So make the macro to include the , and the non-gcc case empty. p4raw-id: //depot/perl@18921 --- diff --git a/sv.h b/sv.h index 219174f..18ad297 100644 --- a/sv.h +++ b/sv.h @@ -527,17 +527,17 @@ Set the length of the string which is in the SV. See C. SVp_IOK|SVp_NOK|SVf_IVisUV)) #ifdef __GNUC__ -#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) 0 +#define assert_not_ROK(sv) #endif #define SvOK(sv) (SvFLAGS(sv) & SVf_OK) -#define SvOK_off(sv) (assert_not_ROK(sv), \ +#define SvOK_off(sv) (assert_not_ROK(sv) \ SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ SVf_IVisUV|SVf_UTF8), \ SvOOK_off(sv)) -#define SvOK_off_exc_UV(sv) (assert_not_ROK(sv), \ +#define SvOK_off_exc_UV(sv) (assert_not_ROK(sv) \ SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ SVf_UTF8), \ SvOOK_off(sv)) @@ -549,7 +549,7 @@ Set the length of the string which is in the SV. See C. #define SvNOKp(sv) (SvFLAGS(sv) & SVp_NOK) #define SvNOKp_on(sv) (SvFLAGS(sv) |= SVp_NOK) #define SvPOKp(sv) (SvFLAGS(sv) & SVp_POK) -#define SvPOKp_on(sv) (assert_not_ROK(sv), \ +#define SvPOKp_on(sv) (assert_not_ROK(sv) \ SvFLAGS(sv) |= SVp_POK) #define SvIOK(sv) (SvFLAGS(sv) & SVf_IOK) @@ -600,14 +600,14 @@ and leaves the UTF8 status as it was. #define SvUTF8_off(sv) (SvFLAGS(sv) &= ~(SVf_UTF8)) #define SvPOK(sv) (SvFLAGS(sv) & SVf_POK) -#define SvPOK_on(sv) (assert_not_ROK(sv), \ +#define SvPOK_on(sv) (assert_not_ROK(sv) \ SvFLAGS(sv) |= (SVf_POK|SVp_POK)) #define SvPOK_off(sv) (SvFLAGS(sv) &= ~(SVf_POK|SVp_POK)) -#define SvPOK_only(sv) (assert_not_ROK(sv), \ +#define SvPOK_only(sv) (assert_not_ROK(sv) \ SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ SVf_IVisUV|SVf_UTF8), \ SvFLAGS(sv) |= (SVf_POK|SVp_POK)) -#define SvPOK_only_UTF8(sv) (assert_not_ROK(sv), \ +#define SvPOK_only_UTF8(sv) (assert_not_ROK(sv) \ SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ SVf_IVisUV), \ SvFLAGS(sv) |= (SVf_POK|SVp_POK))