:: Re: [DNG] An Anti-Initsystem
Top Page
Delete this message
Reply to this message
Author: karl
Date:  
To: dng
Subject: Re: [DNG] An Anti-Initsystem
src/monitor gives warnings and an error:

gcc -Iinclude -O2 -g -W -Wall -Wno-pointer-sign -Wno-sign-compare -Wno-implicit-fallthrough -fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once -c -o tmp/monitor.o src/monitor.c
src/monitor.c: In function ?dummy_handler?:
src/monitor.c:588:27: error: parameter name omitted
  588 | static void dummy_handler(int)
      |                           ^~~
src/monitor.c: In function ?send_fail?:
src/monitor.c:346:5: warning: ignoring return value of ?write? declared with attribute ?warn_unused_result? [-Wunused-result]
  346 |     write(sk, r_msg, sizeof(r_msg));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/monitor.c: In function ?send_success?:
src/monitor.c:354:5: warning: ignoring return value of ?write? declared with attribute ?warn_unused_result? [-Wunused-result]
  354 |     write(sk, r_msg, sizeof(r_msg));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:92: tmp/monitor.o] Error 1


///

Since this is a function definition (it has the empty body {}),
a parameter name is required even if it isn't used:

static void dummy_handler(int)
{}

suggest you change it to something like:

static void dummy_handler(int x)
{(void) x;}

///

About the writes, if you really doesn't care whether they fail or not,
what is the point of having them ?
If it is acceptable that they fail "sometimes", or if you "know" that
they won't fail, you can make that clear by writing (void) write(etc.).

Regards,
/Karl Hammar