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

Don't ignore return values of write(...) #54

Open
haydenmc opened this issue Dec 29, 2020 · 1 comment
Open

Don't ignore return values of write(...) #54

haydenmc opened this issue Dec 29, 2020 · 1 comment
Labels
good first issue Good for newcomers

Comments

@haydenmc
Copy link
Member

We're seeing some warnings, and we ought to address them.

../src/FtlClient.cpp: In member function ‘void FtlClient::RelayPacket(RtpRelayPacket)’:
../src/FtlClient.cpp:108:14: error: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
  108 |         write(mediaSocketHandle, packet.rtpPacketPayload->data(), packet.rtpPacketPayload->size());
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/FtlClient.cpp: In member function ‘void FtlClient::sendControlMessage(std::string)’:
../src/FtlClient.cpp:416:10: error: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
  416 |     write(controlSocketHandle, message.c_str(), message.size());
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
@haydenmc
Copy link
Member Author

haydenmc commented Feb 9, 2021

Added a workaround for the compiler warnings in #60, but we ought to check for bad write return values and respond appropriately. Leaving this issue open to track.

@haydenmc haydenmc closed this as completed Feb 9, 2021
@haydenmc haydenmc reopened this Feb 9, 2021
@danstiner danstiner added the good first issue Good for newcomers label Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants