linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.31k stars 1.01k forks source link

open_posix: fix the testcase of sem_open/s-c1.c build warning #1073

Open extinguish opened 1 year ago

extinguish commented 1 year ago

the sem_open/s-c1.c has build warning, fix the build warning by remove the "static" declaration of "struct row"

Signed-off-by: guoshichao guoshichao@xiaomi.com

metan-ucw commented 9 months ago

This is obviously correct, but I do get a few more errors when trying to compile the test.

../../../stress/threads/sem_open/s-c1.c: In function ‘main’:
../../../stress/threads/sem_open/s-c1.c:114:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
  114 | int main(int argc, char *argv[])
      |          ~~~~^~~~
../../../stress/threads/sem_open/s-c1.c:114:26: warning: unused parameter ‘argv’ [-Wunused-parameter]
  114 | int main(int argc, char *argv[])
      |                    ~~~~~~^~~~~~

The main should be defined as int main(void) and it fails to compile too because of missing -lm for me, I guess that it's missing LDLIBS file with -lm somewhere.

Can you please fix these two problems too?