diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index c1bccfae9..1591fd5d1 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -280,12 +280,7 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val, long* bitp, l else { tmp = ((val >> len) | ((*p) & dmasks[n])); } - *p = tmp; - (*p)++; - - /*Beware of code like this! compiler warning: operation may be undefined - Read GCC manual on -Wsequence-point*/ - /* *p = ((val << -len) | ((*p)++ & dmasks[n])); */ + *p++ = tmp; } /* write the middle words */ diff --git a/src/grib_bits_ibmpow.c b/src/grib_bits_ibmpow.c index 162a7e4a9..df2b7556a 100644 --- a/src/grib_bits_ibmpow.c +++ b/src/grib_bits_ibmpow.c @@ -107,8 +107,7 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val, long* bitp, l else { tmp = ((val >> len) | ((*p) & dmasks[n])); } - *p = tmp; - (*p)++; + *p++ = tmp; } /* write the middle words */