RFR: JDK-8212780: JEP 343: Packaging Tool Implementation
Phil Race
philip.race at oracle.com
Thu May 2 18:25:33 UTC 2019
Although our build system doesn't complain, my local Linux gcc generates
several
warnings which prevent jpackage from building. The attached patch makes
it happy.
There are several of these :-
jpackage/open/src/jdk.jpackage/share/native/libapplauncher/IniFile.cpp:
In member function ‘virtual bool IniFile::GetSection(TString,
OrderedMap<std::__cxx11::basic_string<char>,
std::__cxx11::basic_string<char> >&)’:
/home/prrace/jpackage/open/src/jdk.jpackage/share/native/libapplauncher/IniFile.cpp:192:25:
error: ‘section’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
IniSectionData* section;
A couple of complains about not checking the return value of chdir. My
patch throws an exception
which I think is better than ignoring it and using the wrong directory.
jpackage/open/src/jdk.jpackage/linux/native/libapplauncher/LinuxPlatform.cpp:
In member function ‘virtual void
LinuxPlatform::SetCurrentDirectory(TString)’:
/home/prrace/jpackage/open/src/jdk.jpackage/linux/native/libapplauncher/LinuxPlatform.cpp:129:52:
error: ignoring return value of ‘int chdir(const char*)’, declared with
attribute warn_unused_result [-Werror=unused-result]
chdir(PlatformString(Value).toPlatformString());
^
And this :
jpackage/open/src/jdk.jpackage/unix/native/libapplauncher/PosixPlatform.cpp:
In member function ‘virtual void PosixProcess::SetInput(TString)’:
/home/prrace/jpackage/open/src/jdk.jpackage/unix/native/libapplauncher/PosixPlatform.cpp:313:56:
error: ignoring return value of ‘ssize_t write(int, const void*,
size_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
write(FInputHandle, Value.data(), Value.size());
^
cc1plus: all warnings being treated as errors
-phil.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc.patch
Type: text/x-patch
Size: 2895 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20190502/2a40ee53/gcc.patch>
More information about the core-libs-dev
mailing list