I always saw those two warnings (paraphrased):
Lexer.cpp:197 <anonymous> may be used uninitialized
Server.cpp:1018 ignoring return value of write(...)
I have looked into these two warnings to learn a bit more on cpp.
For the first one, I could remove the warning by removing the anonymous
namespace, but I have no idea of the implications of doing this. I'd
like to hear comments why this warning is thrown.
For the second, I think it's a matter of handling any error code
returned by write. Something like the attached?
--
Julien
Index: src/Lexer.cpp
===================================================================
--- src/Lexer.cpp (revision 38319)
+++ src/Lexer.cpp (working copy)
@@ -132,8 +132,6 @@
-namespace {
-
class CompareTags
: public binary_function<LexerKeyword, LexerKeyword, bool> {
public:
@@ -147,9 +145,7 @@
}
};
-} // end of anon namespace
-
Lexer::Pimpl::Pimpl(LexerKeyword * tab, int num)
: is(&fb_), table(tab), no_items(num),
status(0), lineno(0), commentChar('#')
Index: src/Server.cpp
===================================================================
--- src/Server.cpp (revision 38319)
+++ src/Server.cpp (working copy)
@@ -1015,7 +1015,11 @@
break;
string const cmd = "LYXCMD:pipe:file-open:" +
fname.absFileName() + '\n';
- ::write(pipefd, cmd.c_str(), cmd.length());
+ if (::write(pipefd, cmd.c_str(), cmd.length()) < 0) {
+ lyxerr << "LyXComm: Problem while loading in single-instance mode."
+ << "\nLyXComm: Error sending message : " << cmd
+ << "\nLyXComm: " << strerror(errno) << endl;
+ }
::close(pipefd);
++loaded_files;
it = theFilesToLoad().erase(it);