Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to build using GCC 15 with the C23 standard #30

Open
sharkcz opened this issue Feb 13, 2025 · 2 comments
Open

fails to build using GCC 15 with the C23 standard #30

sharkcz opened this issue Feb 13, 2025 · 2 comments

Comments

@sharkcz
Copy link
Contributor

sharkcz commented Feb 13, 2025

GCC has switched to C23 as the default C language standard and it is not compatible with current sources. A downstream bug is https://bugzilla.redhat.com/show_bug.cgi?id=2340957

reproduced with GCC 14 using -std=gnu23

...
/usr/bin/make --directory OBJ.Linux -f ../makefile PASS='depend' /home/dan/projects/fedora/ogdi/ogdi-ogdi_4_1_1/lib/Linux/static/libvpf.a
make[2]: Entering directory '/home/dan/projects/fedora/ogdi/ogdi-ogdi_4_1_1/vpflib/OBJ.Linux'
gcc -I.. -I/home/dan/projects/fedora/ogdi/ogdi-ogdi_4_1_1/include/Linux -I/home/dan/projects/fedora/ogdi/ogdi-ogdi_4_1_1/vpflib/include -I/home/dan/projects/fedora/ogdi/ogdi-ogdi_4_1_1/vpflib -g -O2 -flto=auto -ffat-lto-objects -fexceptions -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -DDONT_TD_VOID -DUSE_TERMIO -std=gnu23  -Wall -DUNIX=1 -fPIC -I/usr/include/tirpc -Dunix -DSYS_BIG_ENDIAN=0 -DHAVE_ICONV   -c -o vpfselec.o ../vpfselec.c
../vpfselec.c: In function ‘get_fit_tile_primitives’:
../vpfselec.c:94:13: warning: old-style function definition [-Wold-style-definition]
   94 |    set_type get_fit_tile_primitives (covpath, primclass, expression, feature_table, tile,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
../vpfselec.c:103:4: error: number of arguments doesn’t match prototype
  103 |    {
      |    ^
In file included from ../vpfselec.c:41:
../vpfselec.h:22:13: error: prototype declaration
   22 |    set_type get_fit_tile_primitives ();
      |             ^~~~~~~~~~~~~~~~~~~~~~~
../vpfselec.c:113:17: error: too many arguments to function ‘set_init’
  113 |    primitives = set_init (numprims+1);
      |                 ^~~~~~~~
In file included from ../vpfview.h:9,
                 from ../vpfquery.h:5,
                 from ../vpfselec.c:35:
../set.h:47:13: note: declared here
   47 |    set_type set_init ();
      |             ^~~~~~~~
../vpfselec.c:118:4: error: too many arguments to function ‘muse_check_path’
  118 |    muse_check_path (path);
      |    ^~~~~~~~~~~~~~~
In file included from ../vpfselec.c:32:
../musedir.h:71:6: note: declared here
   71 | void muse_check_path ();
      |      ^~~~~~~~~~~~~~~
../vpfselec.c:120:8: error: too many arguments to function ‘muse_access’
  120 |    if (muse_access (path,0) != 0)
      |        ^~~~~~~~~~~
../musedir.h:69:5: note: declared here
   69 | int muse_access ();
      |     ^~~~~~~~~~~
../vpfselec.c:123:10: error: too many arguments to function ‘vpf_open_table’
  123 |    fit = vpf_open_table (path, disk, "rb", NULL);
      |          ^~~~~~~~~~~~~~
In file included from ../vpfview.h:12:
../vpftable.h:249:19: note: declared here
  249 |    vpf_table_type vpf_open_table ();
      |                   ^~~~~~~~~~~~~~
../vpfselec.c:127:15: error: too many arguments to function ‘table_pos’
  127 |    TILE_ID_ = table_pos ("TILE_ID", fit);
      |               ^~~~~~~~~
../vpftable.h:261:10: note: declared here
  261 |    int32 table_pos ();
      |          ^~~~~~~~~
../vpfselec.c:128:15: error: too many arguments to function ‘table_pos’
  128 |    PRIM_ID_ = table_pos ("PRIM_ID", fit);
      |               ^~~~~~~~~
../vpftable.h:261:10: note: declared here
  261 |    int32 table_pos ();
      |          ^~~~~~~~~
../vpfselec.c:129:13: error: too many arguments to function ‘table_pos’
  129 |    FC_ID_ = table_pos ("FC_ID", fit);
      |             ^~~~~~~~~
../vpftable.h:261:10: note: declared here
  261 |    int32 table_pos ();
      |          ^~~~~~~~~
../vpfselec.c:131:16: error: too many arguments to function ‘table_pos’
  131 |       FC_ID_ = table_pos ("FCA_ID", fit);
      |                ^~~~~~~~~
../vpftable.h:261:10: note: declared here
  261 |    int32 table_pos ();
      |          ^~~~~~~~~
../vpfselec.c:132:18: error: too many arguments to function ‘table_pos’
  132 |    FEATURE_ID_ = table_pos ("FEATURE_ID", fit);
      |                  ^~~~~~~~~
../vpftable.h:261:10: note: declared here
  261 |    int32 table_pos ();
      |          ^~~~~~~~~
../vpfselec.c:136:7: error: too many arguments to function ‘vpf_close_table’
  136 |       vpf_close_table (&fit);
      |       ^~~~~~~~~~~~~~~
../vpftable.h:250:9: note: declared here
  250 |    void vpf_close_table ();
      |         ^~~~~~~~~~~~~~~
../vpfselec.c:149:15: error: too many arguments to function ‘muse_check_path’
  149 |               muse_check_path (path);
      |               ^~~~~~~~~~~~~~~
../musedir.h:71:6: note: declared here
   71 | void muse_check_path ();
      |      ^~~~~~~~~~~~~~~
../vpfselec.c:150:19: error: too many arguments to function ‘muse_access’
  150 |               if (muse_access (path,0) == 0)
      |                   ^~~~~~~~~~~
../musedir.h:69:5: note: declared here
   69 | int muse_access ();
      |     ^~~~~~~~~~~
../vpfselec.c:155:31: error: too many arguments to function ‘read_thematic_index’
  155 |                     tileset = read_thematic_index (path, (char*)&tile_id);
      |                               ^~~~~~~~~~~~~~~~~~~
In file included from ../vpfselec.c:38:
../vpftidx.h:64:13: note: declared here
   64 |    set_type read_thematic_index ();
      |             ^~~~~~~~~~~~~~~~~~~
../vpfselec.c:160:31: error: too many arguments to function ‘read_thematic_index’
  160 |                     tileset = read_thematic_index(path,(char *)&short_tile_id);
      |                               ^~~~~~~~~~~~~~~~~~~
../vpftidx.h:64:13: note: declared here
   64 |    set_type read_thematic_index ();
      |             ^~~~~~~~~~~~~~~~~~~
../vpfselec.c:168:17: error: too many arguments to function ‘set_init’
  168 |       tileset = set_init (fit.nrows+1);
      |                 ^~~~~~~~
../set.h:47:13: note: declared here
   47 |    set_type set_init ();
      |             ^~~~~~~~
../vpfselec.c:169:7: error: too many arguments to function ‘set_on’
  169 |       set_on (tileset);
      |       ^~~~~~
../set.h:55:9: note: declared here
   55 |    void set_on ();
      |         ^~~~~~
../vpfselec.c:170:7: error: too many arguments to function ‘set_delete’
  170 |       set_delete (0, tileset);
      |       ^~~~~~~~~~
../set.h:50:9: note: declared here
   50 |    void set_delete ();
      |         ^~~~~~~~~~
../vpfselec.c:179:7: error: too many arguments to function ‘muse_check_path’
  179 |       muse_check_path (path);
      |       ^~~~~~~~~~~~~~~
../musedir.h:71:6: note: declared here
   71 | void muse_check_path ();
      |      ^~~~~~~~~~~~~~~
../vpfselec.c:180:11: error: too many arguments to function ‘muse_access’
  180 |       if (muse_access (path, 0) == 0)
      |           ^~~~~~~~~~~
../musedir.h:69:5: note: declared here
   69 | int muse_access ();
      |     ^~~~~~~~~~~
../vpfselec.c:183:18: error: too many arguments to function ‘read_thematic_index’
  183 |          fcset = read_thematic_index (path, (char*)&fc_id);
      |                  ^~~~~~~~~~~~~~~~~~~
../vpftidx.h:64:13: note: declared here
   64 |    set_type read_thematic_index ();
      |             ^~~~~~~~~~~~~~~~~~~
../vpfselec.c:189:15: error: too many arguments to function ‘set_init’
  189 |       fcset = set_init (fit.nrows+1);
      |               ^~~~~~~~
../set.h:47:13: note: declared here
   47 |    set_type set_init ();
      |             ^~~~~~~~
../vpfselec.c:190:7: error: too many arguments to function ‘set_on’
  190 |       set_on (fcset);
      |       ^~~~~~
../set.h:55:9: note: declared here
   55 |    void set_on ();
      |         ^~~~~~
../vpfselec.c:191:7: error: too many arguments to function ‘set_delete’
  191 |       set_delete (0, fcset);
      |       ^~~~~~~~~~
../set.h:50:9: note: declared here
   50 |    void set_delete ();
      |         ^~~~~~~~~~
../vpfselec.c:196:13: error: too many arguments to function ‘set_intersection’
  196 |    selset = set_intersection (tileset, fcset);
      |             ^~~~~~~~~~~~~~~~
../set.h:60:13: note: declared here
   60 |    set_type set_intersection ();
      |             ^~~~~~~~~~~~~~~~
../vpfselec.c:197:4: error: too many arguments to function ‘set_nuke’
  197 |    set_nuke (&tileset);
      |    ^~~~~~~~
../set.h:62:9: note: declared here
   62 |    void set_nuke ();
      |         ^~~~~~~~
../vpfselec.c:198:4: error: too many arguments to function ‘set_nuke’
  198 |    set_nuke (&fcset);
      |    ^~~~~~~~
../set.h:62:9: note: declared here
   62 |    void set_nuke ();
      |         ^~~~~~~~
../vpfselec.c:200:8: error: too many arguments to function ‘set_empty’
  200 |    if (set_empty (selset))
      |        ^~~~~~~~~
../set.h:48:9: note: declared here
   48 |    int  set_empty ();
      |         ^~~~~~~~~
../vpfselec.c:202:7: error: too many arguments to function ‘vpf_close_table’
  202 |       vpf_close_table (&fit);
      |       ^~~~~~~~~~~~~~~
../vpftable.h:250:9: note: declared here
  250 |    void vpf_close_table ();
      |         ^~~~~~~~~~~~~~~
../vpfselec.c:203:7: error: too many arguments to function ‘set_nuke’
  203 |       set_nuke (&selset);
      |       ^~~~~~~~
../set.h:62:9: note: declared here
   62 |    void set_nuke ();
      |         ^~~~~~~~
../vpfselec.c:210:12: error: too many arguments to function ‘set_min’
  210 |    start = set_min (selset);
      |            ^~~~~~~
../set.h:52:10: note: declared here
   52 |    int32 set_min ();
      |          ^~~~~~~
../vpfselec.c:211:10: error: too many arguments to function ‘set_max’
  211 |    end = set_max (selset);
      |          ^~~~~~~
../set.h:53:10: note: declared here
   53 |    int32 set_max ();
      |          ^~~~~~~
../vpfselec.c:214:19: error: too many arguments to function ‘index_pos’
  214 |    fseek (fit.fp, index_pos (start, fit), SEEK_SET);
      |                   ^~~~~~~~~
../vpftable.h:253:10: note: declared here
  253 |    int32 index_pos ();
      |          ^~~~~~~~~
../vpfselec.c:220:13: error: too many arguments to function ‘read_next_row’
  220 |       row = read_next_row (fit);
      |             ^~~~~~~~~~~~~
../vpftable.h:256:14: note: declared here
  256 |    row_type  read_next_row ();
      |              ^~~~~~~~~~~~~
../vpfselec.c:221:11: error: too many arguments to function ‘set_member’
  221 |       if (set_member (i, selset))
      |           ^~~~~~~~~~
../set.h:51:9: note: declared here
   51 |    int  set_member ();
      |         ^~~~~~~~~~
../vpfselec.c:226:10: error: too many arguments to function ‘get_table_element’
  226 |          get_table_element(PRIM_ID_,row,fit,&prim_id,&count);
      |          ^~~~~~~~~~~~~~~~~
../vpftable.h:262:10: note: declared here
  262 |    void *get_table_element ();
      |          ^~~~~~~~~~~~~~~~~
../vpfselec.c:227:10: error: too many arguments to function ‘get_table_element’
  227 |          get_table_element(FC_ID_,row,fit,&fc_id,&count);
      |          ^~~~~~~~~~~~~~~~~
../vpftable.h:262:10: note: declared here
  262 |    void *get_table_element ();
      |          ^~~~~~~~~~~~~~~~~
../vpfselec.c:228:10: error: too many arguments to function ‘get_table_element’
  228 |          get_table_element(FEATURE_ID_,row,fit,&feature_id,&count);
      |          ^~~~~~~~~~~~~~~~~
../vpftable.h:262:10: note: declared here
  262 |    void *get_table_element ();
      |          ^~~~~~~~~~~~~~~~~
../vpfselec.c:234:16: error: too many arguments to function ‘get_table_element’
  234 |                get_table_element (TILE_ID_, row, fit, &tile_id, &count);
      |                ^~~~~~~~~~~~~~~~~
../vpftable.h:262:10: note: declared here
  262 |    void *get_table_element ();
      |          ^~~~~~~~~~~~~~~~~
../vpfselec.c:238:16: error: too many arguments to function ‘get_table_element’
  238 |                get_table_element(TILE_ID_, row, fit, &short_tile_id, &count);
      |                ^~~~~~~~~~~~~~~~~
../vpftable.h:262:10: note: declared here
  262 |    void *get_table_element ();
      |          ^~~~~~~~~~~~~~~~~
../vpfselec.c:242:10: error: too many arguments to function ‘free_row’
  242 |          free_row (row, fit);
      |          ^~~~~~~~
../vpftable.h:259:9: note: declared here
  259 |    void free_row ();
      |         ^~~~~~~~
../vpfselec.c:246:17: error: too many arguments to function ‘get_row’
  246 |          frow = get_row (feature_id, feature_table);
      |                 ^~~~~~~
../vpftable.h:260:13: note: declared here
  260 |    row_type get_row ();
      |             ^~~~~~~
../vpfselec.c:248:18: error: too many arguments to function ‘set_insert’
  248 |                  set_insert (prim_id, primitives);
      |                  ^~~~~~~~~~
../set.h:49:9: note: declared here
   49 |    void set_insert ();
      |         ^~~~~~~~~~
../vpfselec.c:249:10: error: too many arguments to function ‘free_row’
  249 |          free_row(frow,feature_table);
      |          ^~~~~~~~
../vpftable.h:259:9: note: declared here
  259 |    void free_row ();
      |         ^~~~~~~~
../vpfselec.c:251:7: error: too many arguments to function ‘free_row’
  251 |       free_row (row, fit);
      |       ^~~~~~~~
../vpftable.h:259:9: note: declared here
  259 |    void free_row ();
      |         ^~~~~~~~
../vpfselec.c:254:4: error: too many arguments to function ‘vpf_close_table’
  254 |    vpf_close_table (&fit);
      |    ^~~~~~~~~~~~~~~
../vpftable.h:250:9: note: declared here
  250 |    void vpf_close_table ();
      |         ^~~~~~~~~~~~~~~
../vpfselec.c:255:4: error: too many arguments to function ‘set_nuke’
  255 |    set_nuke (&selset);
      |    ^~~~~~~~
../set.h:62:9: note: declared here
   62 |    void set_nuke ();
      |         ^~~~~~~~
make[2]: *** [<builtin>: vpfselec.o] Error 1
make[2]: Leaving directory '/home/dan/projects/fedora/ogdi/ogdi-ogdi_4_1_1/vpflib/OBJ.Linux'
make[1]: *** [makefile:43: all] Error 2
make[1]: Leaving directory '/home/dan/projects/fedora/ogdi/ogdi-ogdi_4_1_1/vpflib'
make: *** [makefile:39: vpflib] Error 2
```
@rouault
Copy link
Collaborator

rouault commented Feb 13, 2025

GDAL 3.11 will very much likely remove its OGR OGDI driver for that very reason that libogdi is a unmaintenable piece of code (OSGeo/gdal#11744) . If you build OGDI for the purpose of using it with GDAL, you could very likely drop the OGDI dependency right now to avoid loosing your time

@sharkcz
Copy link
Contributor Author

sharkcz commented Feb 13, 2025

thanks for the info, the workaround is simple (add -std=gnu17), but being able to retire ogdi is better :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants