This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Scott and Steve, The OSF/1 C compiler provides the following warning message when compiling $GEMPAK/source/driver/active/xw/xsatim.c: cc: Warning: xsatim.c, line 414: In this statement, the expression "*imgptr++=*(imgptr-xwdth)" modifies "imgptr", and fetches its value in a computation that is not used to produce the modified value without an intervening sequence point. This behavior is undefined. (undefvarfetch) *imgptr++ = *(imgptr - xwdth); I can't attribute any problems to this message, however, the code may be brittle on some other compilers with optimization flags. This made me go back to some conversations I had with Steve Drake and Dave Himes at COMET a while back regarding some HPUX problems in a similar routine. Dave Himes had suggested as an alternative to: else if ( (row != 0) && (rowtrans[row] == rowtrans[row -1]) ){ /* * replicate line */ for ( col = 0; col < xwdth; col++) { *imgptr++ = *(imgptr - xwdth); } continue; /* finish the row */ } Use memcpy: else if ( (row != 0) && (rowtrans[row] == rowtrans[row -1]) ){ /* * replicate line */ memcpy(imgptr, imgptr - xwdth, xwdth); imgptr += xwdth; continue; /* next row */ } Steve Chiswell Unidata User Support