Skip to content

a few more -Wunused-result warnings #1822

Description

@jktjkt
netopeer2-custom/src/netconf_monitoring.c: In function ‘np_getschema_print_yang’:
netopeer2-custom/src/netconf_monitoring.c:471:9: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  471 |         asprintf(&msg, "Failed to open \"%s\" (%s).", filepath, strerror(errno));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netopeer2-custom/src/netconf_monitoring.c:479:9: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  479 |         asprintf(&msg, "Failed to fseek in \"%s\" (%s).", filepath, strerror(errno));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netopeer2-custom/src/netconf_monitoring.c:486:9: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  486 |         asprintf(&msg, "Failed to ftell in \"%s\" (%s).", filepath, strerror(errno));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netopeer2-custom/src/netconf_monitoring.c:500:9: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  500 |         asprintf(&msg, "Failed to read from \"%s\" (%s).", filepath, strerror(errno));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugBug description.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions