Description: I get build errors when trying to build solenv with gcc 7. There is a build log and a proposed fix attached. Steps to Reproduce: 1. checkout and build, it seems to work 2. make clean distclean 3. make Actual Results: It didn't work the second time I ran make, I don't have a good explanation for why not. I futzed around with re-running autogen, but it didn't help. Expected Results: I don't get compiler errors. Reproducible: Sometimes User Profile Reset: No Additional Info: This was a 7.0.0.0.alpha1 build I cloned today.
Created attachment 161210 [details] Compiler log showing the error
Explicitly specifying the type cast just seems like a good practice anyway.
I submitted a patch here: https://gerrit.libreoffice.org/c/core/+/94746
The reason for the error seems to be something to do with how I had the CC and CXX environment variables set on my computer. Regardless, I think the change I submitted is still useful because I think people should prefer using explicit type casts rather than implicit.
Michael Warner committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2af600f16fa59490f4444701a6a02e77c6739b5a tdf#133331: Added explicit type casts to resolve -fpermissive errors It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Michael Warner from comment #1) > Created attachment 161210 [details] > Compiler log showing the error The actual problem appears to be that `... /usr/bin/ccache gcc-8 ... -c $S/solenv/bin/concat-deps.c ...` tries to compile that source file as C++, not as C (and there is no -x option given that would force it to do so). Looks like a ccache bug to me. (That said, the changes in <https://git.libreoffice.org/core/+/2af600f16fa59490f4444701a6a02e77c6739b5a%5E!/> "tdf#133331: Added explicit type casts to resolve -fpermissive errors" are not wrong, just needless clutter for a C source file.)
(In reply to Stephan Bergmann from comment #6) > (In reply to Michael Warner from comment #1) > > Created attachment 161210 [details] > > Compiler log showing the error > > The actual problem appears to be that `... /usr/bin/ccache gcc-8 ... -c > $S/solenv/bin/concat-deps.c ...` tries to compile that source file as C++, > not as C (and there is no -x option given that would force it to do so). > Looks like a ccache bug to me. Maybe so, but this made it work for me. > > (That said, the changes in > <https://git.libreoffice.org/core/+/ > 2af600f16fa59490f4444701a6a02e77c6739b5a%5E!/> "tdf#133331: Added explicit > type casts to resolve -fpermissive errors" are not wrong, just needless > clutter for a C source file.) Different people have different opinions about these kinds of things. Where I work, for example, they would want explicit casts. Is there a coding conventions document for LibreOffice? From just poking around on the website I don't see one; but I would be happy to follow any such guidance.
(In reply to Michael Warner from comment #7) > Different people have different opinions about these kinds of things. Where > I work, for example, they would want explicit casts. Is there a coding > conventions document for LibreOffice? From just poking around on the website > I don't see one; but I would be happy to follow any such guidance. No, we don't have such a set of specific guidelines.