Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile warnings #37

Open
xavierba opened this issue Oct 31, 2019 · 0 comments
Open

Compile warnings #37

xavierba opened this issue Oct 31, 2019 · 0 comments

Comments

@xavierba
Copy link
Contributor

Current maint branch with #36 applied still generate a couple compile warning:

./send_nsca.c: In function 'alarm_handler':
./send_nsca.c:543:2: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
  543 |  write(STDOUT_FILENO, msg, sizeof(msg) - 1);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./nsca.c: In function 'main':
./nsca.c:159:3: warning: ignoring return value of 'getcwd', declared with attribute warn_unused_result [-Wunused-result]
  159 |   getcwd(config_file,sizeof(config_file));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./nsca.c: In function 'write_checkresult_file':
./nsca.c:1285:9: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
 1285 |         asprintf(&checkresult_file,"%s/cXXXXXX",check_result_path);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./nsca.c:1319:9: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
 1319 |         asprintf(&checkresult_ok_file,"%s.ok",checkresult_file);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./nsca.c: In function 'write_pid_file':
./nsca.c:1508:3: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
 1508 |   write(fd,pbuf,strlen(pbuf));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./nsca.c:1509:3: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result [-Wunused-result]
 1509 |   fchown(fd,usr,grp);
      |   ^~~~~~~~~~~~~~~~~~
./nsca.c: In function 'find_rhand':
./nsca.c:743:9: warning: control reaches end of non-void function [-Wreturn-type]
  743 |         }
      |         ^
./nsca.c: In function 'find_whand':
./nsca.c:759:9: warning: control reaches end of non-void function [-Wreturn-type]
  759 |         }
      |         ^
./nsca.c: In function 'read_config_file':
./nsca.c:495:29: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
  495 |                             asprintf(&checkresult_test,"%s/nsca.test.%i",check_result_path,getpid());
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants