Skip to content

Conversation

@tobozo
Copy link
Contributor

@tobozo tobozo commented Oct 12, 2023

C/C++: ordered comparison between pointers and zero

~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Open(sqlite3_vfs*, const char*, sqlite3_file*, int, int*)':
~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:457:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int')
  457 |   if( p->fp<=0){
      |       ~~~~~^~~
~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Delete(sqlite3_vfs*, const char*, int)':
~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:499:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int')
  499 |     if( dfd<=0 ){
      |         ~~~^~~

multiple definitions

xtensa-esp32s3-elf/bin/ld: /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(unishox1.c.o):~/Arduino/libraries/Sqlite3Esp32/src/unishox1.c:60: multiple definition of `c_95'; /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(shox96_0_2.cpp.o):~/Arduino/libraries/Sqlite3Esp32/src/shox96_0_2.cpp:36: first defined here
xtensa-esp32s3-elf/bin/ld: /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(unishox1.c.o):~/Arduino/libraries/Sqlite3Esp32/src/unishox1.c:61: multiple definition of `l_95'; /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(shox96_0_2.cpp.o):~/Arduino/libraries/Sqlite3Esp32/src/shox96_0_2.cpp:37: first defined here
collect2: error: ld returned 1 exit status

~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Open(sqlite3_vfs*, const char*, sqlite3_file*, int, int*)':
~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:457:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int')
  457 |   if( p->fp<=0){
      |       ~~~~~^~~
~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Delete(sqlite3_vfs*, const char*, int)':
~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:499:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int')
  499 |     if( dfd<=0 ){
      |         ~~~^~~
xtensa-esp32s3-elf/bin/ld: /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(unishox1.c.o):~/Arduino/libraries/Sqlite3Esp32/src/unishox1.c:60: multiple definition of `c_95'; /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(shox96_0_2.cpp.o):~/Arduino/libraries/Sqlite3Esp32/src/shox96_0_2.cpp:36: first defined here
xtensa-esp32s3-elf/bin/ld: /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(unishox1.c.o):~/Arduino/libraries/Sqlite3Esp32/src/unishox1.c:61: multiple definition of `l_95'; /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(shox96_0_2.cpp.o):~/Arduino/libraries/Sqlite3Esp32/src/shox96_0_2.cpp:37: first defined here
collect2: error: ld returned 1 exit status
@siara-cc siara-cc merged commit d723213 into siara-cc:master Oct 13, 2023
@siara-cc
Copy link
Owner

Thanks @tobozo
Making c_95 and l_95 static is quick way to fix it

@tobozo
Copy link
Contributor Author

tobozo commented Oct 13, 2023

yup, quick and dirty as I don't know why they're redundant with the other C file and not willing to break things ^^

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

Successfully merging this pull request may close these issues.

2 participants