Opened 5 years ago

Last modified 5 years ago

#15515 new bug

deprecate tempnam, tmpnam, L_tmpnam and gets

Reported by: korli Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

from https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdio.h.html

The gets(), tmpnam(), and tempnam() functions and the L_tmpnam macro are marked obsolescent.
  • definitions in stdio.h should be removed or protected with a macro.
  • release notes should be updated.

Change History (8)

comment:1 by pulkomandy, 5 years ago

I think we can mark them with __attribute__((deprecated)) for gcc8, that will result in a compile time warning. Is there a need for hiding them more than that?

comment:2 by korli, 5 years ago

C11 removed gets() entirely. For this reason: "or protected with a macro".

comment:3 by pulkomandy, 5 years ago

yes, we can use a #if on stdc_version or similar

comment:5 by waddlesplash, 5 years ago

First part done in hrev53682.

comment:6 by X512, 5 years ago

Build broken after this change on x86 native Haiku build:

C++ objects/haiku/x86/release/system/libroot/os/launch.o 
In file included from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/ext/string_conversions.h:43,
                 from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/bits/basic_string.h:6400,
                 from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/string:52,
                 from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/stdexcept:39,
                 from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/array:3,
                 from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/tuple:3,
                 from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/bits/stl_map.h:63,
                 from build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/map:61,
                 from ../headers/private/app/TokenSpace.h:13,
                 from ../src/system/libroot/os/launch.cpp:9:
build_packages/gcc_x86_syslibs_devel-8.3.0_2019_05_24-7-x86_gcc2/develop/headers/x86/c++/cstdio:141:11: error: '::tmpnam' has not been declared
   using ::tmpnam;
           ^~~~~~
Last edited 5 years ago by X512 (previous) (diff)

comment:7 by pulkomandy, 5 years ago

  • gcc_x86 needs to be rebuilt (develop/headers/x86/c++/i586-pc-haiku/bits/c++config.h defines __GLIBCXX_USE_TMPNAM)
  • jasper needs to be patched and rebuilt (uses L_tmpnam)

I think before doing that we need to update the haikuports builders?

Last edited 5 years ago by pulkomandy (previous) (diff)

comment:8 by waddlesplash, 5 years ago

Reverted in hrev53688.

Note: See TracTickets for help on using tickets.