Opened 10 years ago

Closed 9 years ago

#2352 closed defect (fixed)

Conflicting definitions of db__driver_describe_table

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 7.0.3
Component: Database Version: 6.4.3
Keywords: dbf driver, libdb Cc: sebastic@…
CPU: All Platform: All

Description

Hi,

as reported here, http://bugs.debian.org/748680

there is a param def'n conflict for db__driver_describe_table() in db/drivers/dbf/describe.c and lib/db/stubs/desc_table.c.

int db__driver_describe_table(dbString * table_name, dbTable ** table)
  vs
int db__driver_describe_table(dbString * name, dbTable * table)

present in all branches, 6.3.0-trunk.

thanks, Hamish

Change History (12)

comment:1 by martinl, 9 years ago

Milestone: 6.4.5

Ticket retargeted after milestone closed

comment:2 by martinl, 9 years ago

Milestone: 6.4.6

comment:3 by Bas Couwenberg, 9 years ago

Cc: sebastic@… added

This affects 7.0.2-rc2 too:

db/drivers/odbc/describe.c:int db__driver_describe_table(table_name, table)
db/drivers/odbc/dbdriver.h:int db__driver_describe_table();
db/drivers/postgres/describe.c:int db__driver_describe_table(dbString * table_name, dbTable ** table)
db/drivers/postgres/dbdriver.h:int db__driver_describe_table();
db/drivers/ogr/describe.c:int db__driver_describe_table(dbString * table_name, dbTable ** table)
db/drivers/ogr/dbdriver.h:int db__driver_describe_table();
db/drivers/mysql/describe.c:int db__driver_describe_table(dbString * table_name, dbTable ** table)
db/drivers/mysql/dbdriver.h:int db__driver_describe_table();
db/drivers/sqlite/describe.c:int db__driver_describe_table(dbString * table_name, dbTable ** table)
db/drivers/sqlite/dbdriver.h:int db__driver_describe_table();
db/drivers/dbf/describe.c:int db__driver_describe_table(dbString * table_name, dbTable ** table)
db/drivers/dbf/dbdriver.h:int db__driver_describe_table();
lib/db/stubs/desc_table.c:int db__driver_describe_table(dbString * name, dbTable * table)
lib/db/dbmi_driver/dbstubs.h:extern int db__driver_describe_table();

comment:4 by neteler, 9 years ago

This is in this case harmless since

lib/db/stubs/desc_table.c

int db__driver_describe_table(dbString * name, dbTable * table)
{
    db_procedure_not_implemented("db_describe_table");
    return DB_FAILED;
}

Magically the DBMI lib works without it. Mysteries of DBMI which we inherited completely undocumented...

Of course it should be updated properly.

in reply to:  4 comment:5 by glynn, 9 years ago

Replying to neteler:

The prototype for db__driver_open_select_cursor() is also incorrect.

Of course it should be updated properly.

r66772 adds parameter types to the dbdriver.h and dbstubs.h header files. r66773 changes the lib/stubs/*.c files to include the dbstubs.h header, and fixes the two incorrect prototypes.

Ideally, the individual database drivers should also be changed so that each source file includes the driver's dbdriver.h header.

comment:6 by neteler, 9 years ago

Travis-CI shows now some issues:

(cd /home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/lib; ln -f -s libgrass_dbmibase.7.1.svn.so /home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/lib/libgrass_dbmibase.so)
if [ "" != "" -a -f "".html ] ; then make html ; fi
make[4]: Leaving directory `/home/travis/build/GRASS-GIS/grass-ci/lib/db/dbmi_base'
make -C dbmi_client || echo /home/travis/build/GRASS-GIS/grass-ci/lib/db/dbmi_client >> /home/travis/build/GRASS-GIS/grass-ci/error.log
make -C stubs || echo /home/travis/build/GRASS-GIS/grass-ci/lib/db/stubs >> /home/travis/build/GRASS-GIS/grass-ci/error.log
make[4]: Entering directory `/home/travis/build/GRASS-GIS/grass-ci/lib/db/stubs'
test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu
make[4]: Entering directory `/home/travis/build/GRASS-GIS/grass-ci/lib/db/dbmi_client'
test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu
gcc  -g -O2  -fPIC  -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include    -DPACKAGE=\""grasslibs"\"   -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/db/stubs\" -o OBJ.x86_64-pc-linux-gnu/add_col.o -c add_col.c
gcc  -g -O2  -fPIC  -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include     -I../dbmi_base -DPACKAGE=\""grasslibs"\"   -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/db/dbmi_client\" -o OBJ.x86_64-pc-linux-gnu/c_add_col.o -c c_add_col.c
add_col.c:2:27: fatal error: grass/dbstubs.h: No such file or directory
compilation terminated.

...

gcc  -g -O2  -fPIC  -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include     -I../dbmi_base -DPACKAGE=\""grasslibs"\"   -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/db/dbmi_client\" -o OBJ.x86_64-pc-linux-gnu/c_list_drivers.o -c c_list_drivers.c
d_error.c: In function ‘db_d_append_error’:
d_error.c:78:11: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]

...

gcc  -g -O2  -fPIC  -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include     -I../dbmi_base -DPACKAGE=\""grasslibs"\"   -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -I/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/db/dbmi_client\" -o OBJ.x86_64-pc-linux-gnu/select.o -c select.c
gcc -shared -o /home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/lib/libgrass_dbmidriver.7.1.svn.so -L/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/lib -L/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/lib -Wl,--export-dynamic -Wl,-rpath-link,/home/travis/build/GRASS-GIS/grass-ci/dist.x86_64-pc-linux-gnu/lib -Wl,-soname,libgrass_dbmidriver.7.1.svn.so OBJ.x86_64-pc-linux-gnu/d_add_col.o OBJ.x86_64-pc-linux-gnu/d_bindupdate.o OBJ.x86_64-pc-linux-gnu/d_close_cur.o OBJ.x86_64-pc-linux-gnu/d_closedb.o OBJ.x86_64-pc-linux-gnu/d_createdb.o OBJ.x86_64-pc-linux-gnu/d_create_idx.o OBJ.x86_64-pc-linux-gnu/d_create_tab.o OBJ.x86_64-pc-linux-gnu/d_delete.o OBJ.x86_64-pc-linux-gnu/d_deletedb.o OBJ.x86_64-pc-linux-gnu/d_desc_table.o OBJ.x86_64-pc-linux-gnu/d_drop_col.o OBJ.x86_64-pc-linux-gnu/d_drop_index.o OBJ.x86_64-pc-linux-gnu/d_drop_tab.o OBJ.x86_64-pc-linux-gnu/d_error.o OBJ.x86_64-pc-linux-gnu/d_execute.o OBJ.x86_64-pc-linux-gnu/d_fetch.o OBJ.x86_64-pc-linux-gnu/d_finddb.o OBJ.x86_64-pc-linux-gnu/d_insert.o OBJ.x86_64-pc-linux-gnu/d_listdb.o OBJ.x86_64-pc-linux-gnu/d_list_idx.o OBJ.x86_64-pc-linux-gnu/d_list_tabs.o OBJ.x86_64-pc-linux-gnu/d_mkdir.o OBJ.x86_64-pc-linux-gnu/d_opendb.o OBJ.x86_64-pc-linux-gnu/d_openinsert.o OBJ.x86_64-pc-linux-gnu/d_openselect.o OBJ.x86_64-pc-linux-gnu/d_openupdate.o OBJ.x86_64-pc-linux-gnu/d_priv.o OBJ.x86_64-pc-linux-gnu/driver.o OBJ.x86_64-pc-linux-gnu/driver_state.o OBJ.x86_64-pc-linux-gnu/d_rows.o OBJ.x86_64-pc-linux-gnu/d_update.o OBJ.x86_64-pc-linux-gnu/d_version.o  -lgrass_dbmibase.7.1.svn -lgrass_dbstubs.7.1.svn -lgrass_gis.7.1.svn -lm 
/usr/bin/ld: cannot find -lgrass_dbstubs.7.1.svn
collect2: ld returned 1 exit status

The first issue will cause the third (and the second is "just" a warning).

Interestingly, changing into lib/db/stubs/ and running make on my local machine for a second time resolved it. Probably only a Makefile issue?

comment:8 by hcho, 9 years ago

I'm having the same issue when compiling SVN. I needed to copy lib/db/dbmi_driver/dbstubs.h to dist..../include/grass.

in reply to:  8 ; comment:9 by neteler, 9 years ago

Replying to hcho:

I'm having the same issue when compiling SVN. I needed to copy lib/db/dbmi_driver/dbstubs.h to dist..../include/grass.

for the record, fixed by Glynn in r66817

Question: can r66772 + r66773 + r66817 now be backported?

in reply to:  9 comment:10 by martinl, 9 years ago

Replying to neteler:

Replying to hcho:

I'm having the same issue when compiling SVN. I needed to copy lib/db/dbmi_driver/dbstubs.h to dist..../include/grass.

for the record, fixed by Glynn in r66817

Question: can r66772 + r66773 + r66817 now be backported?

Backported to relbr70 in r66884

comment:11 by martinl, 9 years ago

Backport to relbr64 is not so easy, is someone planning to do it. If not, I suggest to change milestone to 7.0.3 and close the ticket.

in reply to:  11 comment:12 by neteler, 9 years ago

Milestone: 6.4.67.0.3
Resolution: fixed
Status: newclosed

Replying to martinl:

Backport to relbr64 is not so easy, is someone planning to do it. If not, I suggest to change milestone to 7.0.3 and close the ticket.

Agreed. Closing for now, feel free to reopen (anyone) if a GRASS GIS 6 patch is provided.

Note: See TracTickets for help on using tickets.