Skip to content

Comments

Rename asprintf to _asprintf to avoid unused-result warnings#337

Merged
Sapd merged 2 commits intoSapd:masterfrom
Leixb:master
Apr 6, 2024
Merged

Rename asprintf to _asprintf to avoid unused-result warnings#337
Sapd merged 2 commits intoSapd:masterfrom
Leixb:master

Conversation

@Leixb
Copy link
Contributor

@Leixb Leixb commented Apr 3, 2024

Changes made

fixes #335

It would probably be best to actually check the return values for errors on writing. Maybe somethign along these lines:

#define ASSERT_ASPRINTF(x) { if (x < 0) {fprintf(stderr, "Error formatting output"); }

Checklist

  • I adjusted the README (if needed)
  • For new features in HeadsetControl: I discussed it beforehand in Issues or Discussions and adhered to the wiki

@Sapd Sapd merged commit bd28a2e into Sapd:master Apr 6, 2024
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.

error: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]

2 participants