[GRASS-dev] [GRASS GIS] #1423: GRASS 6.4.1 won't compile against FFmpeg 0.8

GRASS GIS trac at osgeo.org
Wed Jul 11 08:40:18 PDT 2012


#1423: GRASS 6.4.1 won't compile against FFmpeg 0.8
-------------------------+--------------------------------------------------
 Reporter:  sharpie      |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  critical     |   Milestone:  6.4.3                    
Component:  Compiling    |     Version:  unspecified              
 Keywords:               |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by glynn):

 Replying to [comment:5 wenzeslaus]:
 > Removing `-Werror-implicit-function-declaration` solved the problem but
 I suppose it is not the solution. I also get some `-Wdeprecated-
 declaration` warnings.
 I don't have this problem with ffmpeg 0.10.3. There, av_rescale_q is
 declared in libavutil/mathematics.h, which is included by <avutil.h>.

 Also, your warnings show a couple of significant issues with gvld.c:
 {{{
 gvld.c: In function ‘gvld_isosurf’:
 gvld.c:351:29: warning: operation on ‘*(pos + (unsigned int)((unsigned
 int)i * 4u))’ may be undefined [-Wsequence-point]
 gvld.c:351:29: warning: operation on ‘*(pos + (unsigned int)((unsigned
 int)i * 4u))’ may be undefined [-Wsequence-point]
 }}}
 The code in question is:
 {{{
     if (check_color[i])
         curcolor[i] =
             (READ() & 0xff) | ((READ() & 0xff) << 8) |
             ((READ() & 0xff) << 16);
 }}}
 where the READ() macro is defined as:
 {{{
 #define READ() gvl_read_char(pos[i]++, gvl->isosurf[i]->data)
 }}}
 The problem is that, in an expression such as "A | B", if A and B have
 side-effects, the C standard doesn't specify the order in which those
 side-effects occur. I suspect that the code was written on the assumption
 of left-to-right evaluation, in which case it should read e.g.:
 {{{
     if (check_color[i]) {
         unsigned r = READ();
         unsigned g = READ();
         unsigned b = READ();
         curcolor[i] =
             (r & 0xff) | ((r & 0xff) << 8) |
             ((r & 0xff) << 16);
 }}}
 There's another bug on line 367:
 {{{
         gsd_set_material(1, 1, ksh[i], kem[i],
                          (int)curcolor);
 }}}
 This should probably have been:
 {{{
         gsd_set_material(1, 1, ksh[i], kem[i],
                          curcolor[i]);
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1423#comment:6>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list