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

Fix more mostly benign Linux/GCC compiler warnings #827

Merged
merged 1 commit into from Mar 15, 2024

Conversation

droe
Copy link
Contributor

@droe droe commented Mar 15, 2024

In file included from src/send-internal.h:23,
                 from src/send.c:31:
src/send-linux.h:25:27: warning: ‘sockaddr’ defined but not used [-Wunused-variable]
   25 | static struct sockaddr_ll sockaddr;
      |                           ^~~~~~~~
src/send.c: In function ‘send_run’:
src/send.c:457:30: warning: ‘attempts’ may be used uninitialized [-Wmaybe-uninitialized]
  457 |         if (!zconf.dryrun && send_batch(st, batch, attempts) < 0) {
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/send.c:303:13: note: ‘attempts’ was declared here
  303 |         int attempts = zconf.retries + 1;
      |             ^~~~~~~~
src/probe_modules/module_dns.c: In function ‘dns_global_initialize’:
src/probe_modules/module_dns.c:637:25: warning: ‘__builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
  637 |                         strncpy(domain_ptr, domain_token, domain_len);
      |                         ^
src/probe_modules/module_dns.c:634:43: note: length computed here
  634 |                         uint domain_len = strlen(domain_token);
      |                                           ^~~~~~~~~~~~~~~~~~~~

In file included from src/send-internal.h:23,
                 from src/send.c:31:
src/send-linux.h:25:27: warning: ‘sockaddr’ defined but not used [-Wunused-variable]
   25 | static struct sockaddr_ll sockaddr;
      |                           ^~~~~~~~
src/send.c: In function ‘send_run’:
src/send.c:457:30: warning: ‘attempts’ may be used uninitialized [-Wmaybe-uninitialized]
  457 |         if (!zconf.dryrun && send_batch(st, batch, attempts) < 0) {
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/send.c:303:13: note: ‘attempts’ was declared here
  303 |         int attempts = zconf.retries + 1;
      |             ^~~~~~~~
src/probe_modules/module_dns.c: In function ‘dns_global_initialize’:
src/probe_modules/module_dns.c:637:25: warning: ‘__builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
  637 |                         strncpy(domain_ptr, domain_token, domain_len);
      |                         ^
src/probe_modules/module_dns.c:634:43: note: length computed here
  634 |                         uint domain_len = strlen(domain_token);
      |                                           ^~~~~~~~~~~~~~~~~~~~
@zakird zakird merged commit 3939d83 into zmap:main Mar 15, 2024
11 checks passed
@droe droe deleted the droe/fix-even-more-compiler-warnings branch March 25, 2024 23:32
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.

None yet

2 participants