freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Type42 + gcc3.x: operation may be undefind


From: Sebastien BARRE
Subject: [Devel] Type42 + gcc3.x: operation may be undefind
Date: Thu, 20 Jun 2002 13:01:26 -0400

Hi

Here is a warning I get while compiling Freetype with gcc 3.x:

/mnt/home/mpiuser/vtknew/Utilities/freetype/src/type42/t42parse.c: In function `t42_parse_sfnts': /mnt/home/mpiuser/vtknew/Utilities/freetype/src/type42/t42parse.c:632: warning: operation on `cur' may be undefined

Line 632 is:

v = (FT_Byte)( 16 * t42_hexval( *cur++ ) + t42_hexval( *cur++ ) );

We suspect that it occurs because of two cur++ on the same line/statement. Therefore, the execution order might be undefined.

The fix is:

  v = (FT_Byte)( 16 * t42_hexval( *cur ) + t42_hexval( *(cur+1) ) );
  cur += 2;

provided of course that the first cur++ was the first to be executed.

Hope this helps




reply via email to

[Prev in Thread] Current Thread [Next in Thread]