ncruces/dcraw

Run script install error in ubuntu 22.04

Closed this issue · 1 comments

ducpx commented

I tried to install dcraw 9.28 on ubuntu 22.04 dcraw-9.28.0.tar.gz.

I installed these packages: apt-get install libjasper-dev libjpeg-dev liblcms2-dev gettext libghc-iconv-dev -y

There was error:

root@user# ./install 
dcraw.c: In function 'read_shorts':
dcraw.c:366:5: warning: passing argument 2 to 'restrict'-qualified parameter aliases with argument 1 [-Wrestrict]
  366 |     swab (pixel, pixel, count*2);
      |     ^~~~
dcraw.c: In function 'canon_sraw_load_raw':
dcraw.c:1001:8: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
 1001 |     if (row & (jh.sraw >> 1))
      |        ^
dcraw.c: In function 'fill_input_buffer':
dcraw.c:2310:22: warning: passing argument 2 to 'restrict'-qualified parameter aliases with argument 1 [-Wrestrict]
 2310 |   swab (jpeg_buffer, jpeg_buffer, nbytes);
      |         ~~~~~~~~~~~  ^~~~~~~~~~~
dcraw.c: In function 'smal_decode_segment':
dcraw.c:2890:7: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 2890 |       for (bin=0; hist[s][bin+5] > count; bin++);
      |       ^~~
dcraw.c:2891:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 2891 |                 low = hist[s][bin+5] * (high >> 4) >> 2;
      |                 ^~~
dcraw.c: In function 'pre_interpolate':
dcraw.c:4321:13: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
 4321 |             if (!(image[row*width+col][0] | image[row*width+col][2]))
      |             ^~
dcraw.c:4322:29: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
 4322 |               goto break2;  break2:
      |                             ^~~~~~
dcraw.c: In function 'parse_gps':
dcraw.c:164:19: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  164 | #define FORC(cnt) for (c=0; c < cnt; c++)
      |                   ^~~
dcraw.c:5537:9: note: in expansion of macro 'FORC'
 5537 |         FORC(6) gpsdata[tag/3*6+c] = get4();            break;
      |         ^~~~
dcraw.c:5537:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 5537 |         FORC(6) gpsdata[tag/3*6+c] = get4();            break;
      |                                                         ^~~~~
dcraw.c:164:19: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  164 | #define FORC(cnt) for (c=0; c < cnt; c++)
      |                   ^~~
dcraw.c:5539:9: note: in expansion of macro 'FORC'
 5539 |         FORC(2) gpsdata[18+c] = get4();                 break;
      |         ^~~~
dcraw.c:5539:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 5539 |         FORC(2) gpsdata[18+c] = get4();                 break;
      |                                                         ^~~~~
dcraw.c: In function 'parse_tiff_ifd':
dcraw.c:6074:25: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
 6074 |         if (!(cblack[4] * cblack[5]))
      |              ~~~~~~~~~~~^~~~~~~~~~~~
dcraw.c: In function 'apply_tiff':
dcraw.c:6313:11: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
 6313 |         } else
      |           ^~~~
dcraw.c:6314:65: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
 6314 |           load_raw = &CLASS nikon_load_raw;                     break;
      |                                                                 ^~~~~
dcraw.c: In function 'write_ppm_tiff':
dcraw.c:10078:7: warning: passing argument 2 to 'restrict'-qualified parameter aliases with argument 1 [-Wrestrict]
10078 |       swab (ppm2, ppm2, width*colors*2);
      |       ^~~~
dcraw.c: In function 'main':
dcraw.c:164:19: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  164 | #define FORC(cnt) for (c=0; c < cnt; c++)
      |                   ^~~
dcraw.c:166:15: note: in expansion of macro 'FORC'
  166 | #define FORC4 FORC(4)
      |               ^~~~
dcraw.c:10165:12: note: in expansion of macro 'FORC4'
10165 |            FORC4 user_mul[c] = atof(argv[arg++]);  break;
      |            ^~~~~
dcraw.c:10165:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
10165 |            FORC4 user_mul[c] = atof(argv[arg++]);  break;
      |                                                    ^~~~~
dcraw.c:10170:18: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
10170 |                  if (gamm[0]) gamm[0] = 1/gamm[0]; break;
      |                  ^~
dcraw.c:10170:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
10170 |                  if (gamm[0]) gamm[0] = 1/gamm[0]; break;
      |                                                    ^~~~~
In function 'read_shorts',
    inlined from 'nikon_load_raw' at dcraw.c:1210:3:
dcraw.c:366:5: warning: 'swab' reading 8 bytes from a region of size 4 [-Wstringop-overread]
  366 |     swab (pixel, pixel, count*2);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
dcraw.c: In function 'nikon_load_raw':
dcraw.c:1200:29: note: source object 'vpred' of size 4
 1200 |   ushort *huff, ver0, ver1, vpred[2][2], hpred[2], csize;
      |                             ^~~~~
In function 'read_shorts',
    inlined from 'nikon_load_raw' at dcraw.c:1210:3:
dcraw.c:366:5: warning: 'swab' writing 8 bytes into a region of size 4 overflows the destination [-Wstringop-overflow=]
  366 |     swab (pixel, pixel, count*2);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
dcraw.c: In function 'nikon_load_raw':
dcraw.c:1200:29: note: destination object 'vpred' of size 4
 1200 |   ushort *huff, ver0, ver1, vpred[2][2], hpred[2], csize;
      |                             ^~~~~
In file included from dcraw.c:64:
/usr/include/unistd.h:1168:13: note: in a call to function 'swab' declared with attribute 'access (write_only, 2, 3)'
 1168 | extern void swab (const void *__restrict __from, void *__restrict __to,
      |             ^~~~
dcraw.c: In function 'identify':
dcraw.c:9190:33: warning: '%-10s' directive writing between 10 and 56 bytes into a region of size 38 [-Wformat-overflow=]
 9190 |       sprintf (model+20, "DYNAX %-10s", model+6+(model[0]=='M'));
      |                                 ^~~~~
In file included from /usr/include/stdio.h:894,
                 from dcraw.c:39:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: '__builtin___sprintf_chk' output between 17 and 63 bytes into a destination of size 44
   38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   40 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
dcraw.c: In function 'tiff_head':
dcraw.c:9958:28: warning: '%02d' directive writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-overflow=]
 9958 |   sprintf (th->date, "%04d:%02d:%02d %02d:%02d:%02d",
      |                            ^~~~
dcraw.c:9958:22: note: directive argument in the range [-2147483647, 2147483647]
 9958 |   sprintf (th->date, "%04d:%02d:%02d %02d:%02d:%02d",
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:894,
                 from dcraw.c:39:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: '__builtin___sprintf_chk' output between 20 and 72 bytes into a destination of size 20
   38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   40 |                                   __va_arg_pack ());

This is a mirror of dcraw, not really the place to ask about the original source code. I suggest sending a mail to Dave.

I can only comment, or offer support, for my changes and binaries I compile from them.

If you want to build my version for Linux, it should be simple enough. If you don't know how to do that (and/or overcome any issues you might have with it), you should probably be installing precompiled binaries from your package manager, not compiling from source.

Those are warnings, not errors.