Skip to content

Commit

Permalink
8324243: Compilation failures in java.desktop module with gcc 14
Browse files Browse the repository at this point in the history
Reviewed-by: mdoerr
Backport-of: 8e5f6ddb68572c0cc8b6e256e423706f6f7cec94
  • Loading branch information
Jan Kratochvil authored and TheRealMDoerr committed May 17, 2024
1 parent 142b55d commit 4755a79
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion make/modules/java.desktop/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,11 @@ else
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
# calloc-transposed-args required for GCC 14 builds. (fixed upstream in Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92)
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
maybe-uninitialized class-memaccess unused-result extra use-after-free noexcept-type \
expansion-to-defined dangling-reference maybe-uninitialized
expansion-to-defined dangling-reference maybe-uninitialized \
calloc-transposed-args
HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
tautological-constant-out-of-range-compare int-to-pointer-cast \
undef missing-field-initializers range-loop-analysis \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ MidiMessage* MIDI_IN_GetMessage(MidiDeviceHandle* handle) {
return NULL;
}
}
jdk_message = (MidiMessage*) calloc(sizeof(MidiMessage), 1);
jdk_message = (MidiMessage*) calloc(1, sizeof(MidiMessage));
if (!jdk_message) {
ERROR0("< ERROR: MIDI_IN_GetMessage(): out of memory\n");
return NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ INT32 openMidiDevice(snd_rawmidi_stream_t direction, INT32 deviceIndex,

TRACE0("> openMidiDevice()\n");

(*handle) = (MidiDeviceHandle*) calloc(sizeof(MidiDeviceHandle), 1);
(*handle) = (MidiDeviceHandle*) calloc(1, sizeof(MidiDeviceHandle));
if (!(*handle)) {
ERROR0("ERROR: openDevice: out of memory\n");
return MIDI_OUT_OF_MEMORY;
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/share/native/libfontmanager/sunFont.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int isNullScalerContext(void *context) {
*/
JNIEXPORT jlong JNICALL Java_sun_font_NullFontScaler_getGlyphImage
(JNIEnv *env, jobject scaler, jlong pContext, jint glyphCode) {
void *nullscaler = calloc(sizeof(GlyphInfo), 1);
void *nullscaler = calloc(1, sizeof(GlyphInfo));
return ptr_to_jlong(nullscaler);
}

Expand Down

0 comments on commit 4755a79

Please sign in to comment.