Closed WilliamTambellini closed 1 year ago
It would be good to suppress the warning, but assert
is not the right way to do it. assert
may crash the whole program because of failed logging write.
Hi @Maratyszcza
Sure, what about logging (warning ?error ?) if the rv == -1 ?
rv == -1
indicates that we've had an error during logging. I don't expect anything good attempting to log the error about the logging error. The best option IMO is to ignore the error, and silence the compiler warning about it.
Well, totally ignoring write() errors would make debugging even harder but nevermind. So would you accept a PR if I add target_compile_options(... "-Wno-unused-result") to the main CMakeList.txt, only for gcc builds ?
Fixed in #129
Dozens of warnings in clog.c:
line 112 https://github.com/pytorch/cpuinfo/blob/728f3e909fa5c57e0123c4658e234f6b1941385d/deps/clog/src/clog.c#L112
write() indeed returns a size_t : https://linux.die.net/man/2/write Would you mind if I add a check ? eg: