On Friday 09 August 2013 12:56:34 René Rebe wrote:
> Hi,
> 
> I finally rather updated the draw and glue to latest upstream. Please let me
> know if you still get an issue e.g. with GCC 4.8

Not the best start (attached dcraw_build_failure.txt). Maybe you can include 
<arpa/inet.h> (dcraw.c) and <unistd.h> (dcraw.c)

But the best part at the end: the problem is still there (at least the one
GCC automatically can detect; attached dcraw_oob_aggressive.txt). I am not 
sure whether I've already linked the explanation from the GCC guys but here it 
is: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54136 

As reference my build flags:

export CFLAGS="-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
         -Werror=format-security -fopenmp -ffunction-sections -fdata-sections"
export CPPFLAGS="-D_FORTIFY_SOURCE=2"
export CXXFLAGS="-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
         -Werror=format-security"
export LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,--gc-sections"

And my GCC version

gcc (Debian 4.8.1-8) 4.8.1

Kind regards,
        Sven
  C++       objdir/codecs/dcraw.o
In file included from codecs/dcraw.cc:135:0:
codecs/dcraw.h: In function ‘double dcraw::getreal(int)’:
codecs/dcraw.h:369:52: error: ‘ntohs’ was not declared in this scope
       rev = 7 * ((order == 0x4949) == (ntohs(0x1234) == 0x1234));
                                                    ^
codecs/dcraw.h: In function ‘void dcraw::read_shorts(short unsigned int*, int)’:
codecs/dcraw.h:380:41: error: ‘ntohs’ was not declared in this scope
   if ((order == 0x4949) == (ntohs(0x1234) == 0x1234))
                                         ^
codecs/dcraw.h:381:32: error: ‘swab’ was not declared in this scope
     swab (pixel, pixel, count*2);
                                ^
codecs/dcraw.h: In function ‘void dcraw::sony_decrypt(unsigned int*, int, int, 
int)’:
codecs/dcraw.h:2396:28: error: ‘htonl’ was not declared in this scope
       pad[p] = htonl(pad[p]);
                            ^
codecs/dcraw.h: In function ‘void dcraw::sony_load_raw()’:
codecs/dcraw.h:2423:41: error: ‘ntohs’ was not declared in this scope
       if ((pixel[col] = ntohs(pixel[col])) >> 14) derror();
                                         ^
codecs/dcraw.h: In function ‘void dcraw::bad_pixels(const char*)’:
codecs/dcraw.h:3504:32: error: ‘getcwd’ was not declared in this scope
       if (getcwd (fname, len-16)) break;
                                ^
codecs/dcraw.h: In function ‘void dcraw::subtract(const char*)’:
codecs/dcraw.h:3584:62: error: ‘ntohs’ was not declared in this scope
       BAYER(row,col) = MAX (BAYER(row,col) - ntohs(pixel[col]), 0);
                                                              ^
codecs/dcraw.h:187:20: note: in definition of macro ‘MAX’
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
                    ^
codecs/dcraw.h: In function ‘void dcraw::vng_interpolate()’:
codecs/dcraw.h:4093:3: warning: narrowing conversion of ‘128’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
   }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
   ^
codecs/dcraw.h:4093:3: warning: narrowing conversion of ‘136’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4093:3: warning: narrowing conversion of ‘128’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4093:3: warning: narrowing conversion of ‘136’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4093:3: warning: narrowing conversion of ‘128’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4093:3: warning: narrowing conversion of ‘136’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h: In function ‘void dcraw::adobe_coeff(const char*, const char*)’:
codecs/dcraw.h:7378:3: warning: narrowing conversion of ‘65535’ from ‘int’ to 
‘short int’ inside { } is ill-formed in C++11 [-Wnarrowing]
   };
   ^
codecs/dcraw.h: In function ‘void dcraw::convert_to_rgb()’:
codecs/dcraw.h:8717:32: error: ‘htonl’ was not declared in this scope
       oprof[i] = htonl(oprof[i]);
                                ^
codecs/dcraw.h: In function ‘void dcraw::tiff_head(dcraw::tiff_hdr*, int)’:
codecs/dcraw.h:8879:31: error: ‘htonl’ was not declared in this scope
   th->order = htonl(0x4d4d4949) >> 16;
                               ^
codecs/dcraw.h:8897:38: error: ‘ntohl’ was not declared in this scope
     if (oprof) psize = ntohl(oprof[0]);
                                      ^
codecs/dcraw.h: In function ‘void dcraw::jpeg_thumb()’:
codecs/dcraw.h:8960:35: error: ‘htons’ was not declared in this scope
     exif[1] = htons (8 + sizeof th);
                                   ^
codecs/dcraw.h: In function ‘void dcraw::vng_interpolate()’:
codecs/dcraw.h:4094:3: warning: narrowing conversion of ‘128’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
   }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
   ^
codecs/dcraw.h:4094:3: warning: narrowing conversion of ‘136’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4094:3: warning: narrowing conversion of ‘128’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4094:3: warning: narrowing conversion of ‘136’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4094:3: warning: narrowing conversion of ‘128’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h:4094:3: warning: narrowing conversion of ‘136’ from ‘int’ to 
‘const signed char’ inside { } is ill-formed in C++11 [-Wnarrowing]
codecs/dcraw.h: In function ‘void dcraw::parse_phase_one(int)’:
codecs/dcraw.h:6220:26: warning: variable ‘type’ set but not used 
[-Wunused-but-set-variable]
   unsigned entries, tag, type, len, data, save, i, c;
                          ^
codecs/dcraw.h: In function ‘void dcraw::adobe_coeff(const char*, const char*)’:
codecs/dcraw.h:7379:3: warning: narrowing conversion of ‘65535’ from ‘int’ to 
‘short int’ inside { } is ill-formed in C++11 [-Wnarrowing]
   };
   ^
codecs/dcraw.h: In function ‘void dcraw::kodak_radc_load_raw()’:
codecs/dcraw.h:1993:24: warning: iteration 386u invokes undefined behavior 
[-Waggressive-loop-optimizations]
     buf[0][0][i] = 2048;
                        ^
codecs/dcraw.h:1992:3: note: containing loop
   for (i=0; i < sizeof(buf)/sizeof(short); i++)
   ^
codecs/dcraw.h:2002:29: warning: iteration 386u invokes undefined behavior 
[-Waggressive-loop-optimizations]
  buf[c][0][i] = (buf[c][0][i] * val + x) >> s;
                             ^
codecs/dcraw.h:2001:7: note: containing loop
       for (i=0; i < sizeof(buf[0])/sizeof(short); i++)
       ^
codecs/dcraw.h: In function ‘void dcraw::smal_decode_segment(unsigned int 
(*)[2], int)’:
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
    for (i=bin; i < hist[s][1]; i++) hist[s][i+5]--;
                                                ^
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:2558:48: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h: In function ‘void dcraw::foveon_interpolate()’:
codecs/dcraw.h:3099:35: warning: iteration 2u invokes undefined behavior 
[-Waggressive-loop-optimizations]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3098:5: note: containing loop
     for (i=0; i < 6; i++)
     ^
codecs/dcraw.h:3145:35: warning: iteration 2u invokes undefined behavior 
[-Waggressive-loop-optimizations]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3144:5: note: containing loop
     for (i=0; i < 6; i++)
     ^
codecs/dcraw.h:3145:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3146:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3145:19: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                   ^
codecs/dcraw.h:3145:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3146:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3145:19: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                   ^
codecs/dcraw.h:3145:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3146:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3145:19: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                   ^
codecs/dcraw.h:3145:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3146:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3145:19: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                   ^
codecs/dcraw.h:3099:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3100:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3099:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3100:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3099:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3100:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3099:35: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                                   ^
codecs/dcraw.h:3100:36: warning: array subscript is above array bounds 
[-Warray-bounds]
  row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]);
                                    ^
codecs/dcraw.h:3099:19: warning: array subscript is above array bounds 
[-Warray-bounds]
       ddft[0][0][i] = ddft[1][0][i] +
                   ^
codecs/dcraw.h:3099:19: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:3099:19: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:3099:19: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h: In function ‘void dcraw::ppg_interpolate()’:
codecs/dcraw.h:4237:8: warning: array subscript is above array bounds 
[-Warray-bounds]
  diff[i] = ABS(pix[-d][c] - pix[d][c]) +
        ^
codecs/dcraw.h:4240:9: warning: array subscript is above array bounds 
[-Warray-bounds]
  guess[i] = pix[-d][c] + pix[d][c] + 2*pix[0][1]
         ^
codecs/dcraw.h: In function ‘void dcraw::xtrans_interpolate(int)’:
codecs/dcraw.h:4296:27: warning: ‘sgcol’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
   ushort min, max, sgrow, sgcol;
                           ^
codecs/dcraw.h:4343:19: warning: ‘sgrow’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
       switch ((row-sgrow) % 3) {
                   ^
codecs/dcraw.h: In function ‘void dcraw::parse_mos(int)’:
codecs/dcraw.h:5215:39: warning: iteration 3u invokes undefined behavior 
[-Waggressive-loop-optimizations]
  romm_cam[0][i] = int_to_float(get4());
                                       ^
codecs/dcraw.h:5214:7: note: containing loop
       for (i=0; i < 9; i++)
       ^
codecs/dcraw.h: In function ‘void dcraw::parse_phase_one(int)’:
codecs/dcraw.h:6242:32: warning: iteration 3u invokes undefined behavior 
[-Waggressive-loop-optimizations]
    romm_cam[0][i] = getreal(11);
                                ^
codecs/dcraw.h:6241:2: note: containing loop
  for (i=0; i < 9; i++)
  ^
codecs/dcraw.h: In function ‘void dcraw::adobe_coeff(const char*, const char*)’:
codecs/dcraw.h:7391:47: warning: iteration 3u invokes undefined behavior 
[-Waggressive-loop-optimizations]
    cam_xyz[0][j] = table[i].trans[j] / 10000.0;
                                               ^
codecs/dcraw.h:7390:2: note: containing loop
  for (j=0; j < 12; j++)
  ^
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
    cam_xyz[0][j] = table[i].trans[j] / 10000.0;
                ^
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]
codecs/dcraw.h:7391:16: warning: array subscript is above array bounds 
[-Warray-bounds]

Attachment: signature.asc
Description: This is a digitally signed message part.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[email protected] with a subject of: unsubscribe exact-image

Reply via email to