unikraft / lib-newlib

Unikraft port of newlib, a C standard library
Other
5 stars 23 forks source link

Fix warning due to the 'utime' function not being declared in newlib. #17

Open Raphalex46 opened 2 years ago

Raphalex46 commented 2 years ago

This PR is part of the Unikraft Lyon Hackathon.

This warning occured while building app-sqlite :

/home/ubuntu/challenges/sqlite-warnings/apps/app-sqlite/build/libsqlite/origin/sqlite-amalgamation-3300100/sqlite3.c: In function ‘dotlockLock’:
/home/ubuntu/challenges/sqlite-warnings/apps/app-sqlite/build/libsqlite/origin/sqlite-amalgamation-3300100/sqlite3.c:34975:5: warning: implicit declaration of function ‘utime’; did you mean ‘utimes’? [-Wimplicit-function-declaration]
34975 |     utime(zLockFile, NULL);
      |     ^~~~~
      |     utimes

This is apparently due to the fact that lib-sqlite relies on lib-newlib and not on nolibc, and the utime function is not declared correctly in newlib, even though lib-sqlite clearly defines the HAVE_UTIME macro.

StefanJum commented 2 years ago

@Raphalex46 hi, thank you for this. I was not able to reproduce the warning, Did you build nginx with everything on the staging branch (unikraft core, lib-nginx, lib-pthread-embedded, lib-lwip and lib-newlib)?

Raphalex46 commented 2 years ago

@StefanJum Hi,

I'm sorry but I really can't tell you, this was done a while ago for the Unikraft hackathon and I really don't remember the exact setup at the time, and I can't really test this at the moment either.

StefanJum commented 2 years ago

@StefanJum Hi,

I'm sorry but I really can't tell you, this was done a while ago for the Unikraft hackathon and I really don't remember the exact setup at the time, and I can't really test this at the moment either.

It's fine, don't worry. I will keep looking at different setups to see if the warning pops up. If you remember anything at any time let me know.