[jdk11u-dev] RFR: 8296812: sprintf is deprecated in Xcode 14 [v3]

Antonio Vieiro duke at openjdk.org
Tue Jul 16 19:56:29 UTC 2024


On Tue, 16 Jul 2024 10:42:46 GMT, George Adams <gdams at openjdk.org> wrote:

>> Antonio Vieiro has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit:
>> 
>>   Backport 478ef389dc3767edfbe21d10a7f7f1522c648c2e
>
> src/hotspot/share/adlc/adlc.hpp line 115:
> 
>> 113: extern int snprintf_checked(char* buf, size_t len, const char* fmt, ...);
>> 114: 
>> 115: #endif // SHARE_ADLC_ADLC_HPP
> 
> This shouldn't have come across with the patch, please also add the newline
> 
> Suggestion:

The forward declaration of `snprintf_checked` is indeed required, otherwise bad things happen [1]

I've submitted a new commit that replaces `SHARE_ADLC_ADLC_HPP` with `SHARE_VM_ADLC_ADLC_HPP` and adds the extra newline.


[1]

ERROR: Build failed for target 'images' in configuration 'linux-x86_64-normal-server-release' (exit code 2) 

=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_tools_adlc_objs_adlparse.o:
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp: In member function 'void ADLParser::instr_parse()':
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp:215:11: error: 'snprintf_checked' was not declared in this scope
  215 |           snprintf_checked(buf, buf_size, "%s_%d", instr->_ident, match_rules_cnt++);
      |           ^~~~~~~~~~~~~~~~
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp: In member function 'void ADLParser::ins_encode_parse_block(InstructForm&)':
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp:2864:3: error: 'snprintf_checked' was not declared in this scope
 2864 |   snprintf_checked(ec_name, ec_name_size, "%s%s", prefix, inst._ident);
      |   ^~~~~~~~~~~~~~~~
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp: In member function 'void ADLParser::constant_parse(InstructForm&)':
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp:3336:3: error: 'snprintf_checked' was not declared in this scope
 3336 |   snprintf_checked(ec_name, ec_name_size, "%s%s", prefix, inst._ident);
      |   ^~~~~~~~~~~~~~~~
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp: In member function 'char* ADLParser::get_ident_or_literal_constant(const char*)':
/home/antonio/REPOS/OPENJDK/jdk11u-dev/src/hotspot/share/adlc/adlparse.cpp:4657:7: error: 'snprintf_checked' was not declared in this scope
 4657 |       snprintf_checked(buf, buf_size, "(%s)", param);
   ... (rest of output omitted)

-------------

PR Review Comment: https://git.openjdk.org/jdk11u-dev/pull/2836#discussion_r1679993121


More information about the jdk-updates-dev mailing list