[libc-commits] [libc] [libc]: Clean up unnecessary function pointers in scanf (PR #121215)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Thu Feb 20 10:35:17 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-offload-libc-amdgpu-runtime` running on `omp-vega20-1` while building `libc` at step 5 "compile-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/13359

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (compile-openmp) failure: build (failure)
...
0.685 [395/34/271] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_one_ul.dir/stdc_first_leading_one_ul.cpp.o
0.685 [394/34/272] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_one_ull.dir/stdc_first_leading_one_ull.cpp.o
0.686 [393/34/273] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_uc.dir/stdc_first_trailing_zero_uc.cpp.o
0.686 [392/34/274] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.stdin.dir/stdin.cpp.o
0.686 [391/34/275] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.stdout.dir/stdout.cpp.o
0.687 [390/34/276] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.stderr.dir/stderr.cpp.o
0.688 [389/34/277] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_us.dir/stdc_first_trailing_zero_us.cpp.o
0.689 [388/34/278] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_ul.dir/stdc_first_trailing_zero_ul.cpp.o
0.689 [387/34/279] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_ui.dir/stdc_first_trailing_zero_ui.cpp.o
0.690 [386/34/280] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o
FAILED: libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o 
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc -isystem /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa -O3 -DNDEBUG --target=amdgcn-amd-amdhsa -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)" -fpie -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -nogpulib -fvisibility=hidden -fconvergent-functions -flto -Wno-multi-gpu -Xclang -mcode-object-version=none -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -DLIBC_COPT_SCANF_DISABLE_FLOAT -DLIBC_COPT_SCANF_DISABLE_INDEX_MODE -MD -MT libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o -MF libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o.d -o libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o -c /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf.cpp
In file included from /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf.cpp:14:
In file included from /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf_core/vfscanf_internal.h:16:
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf_core/reader.h:38:10: error: no member named 'getc' in namespace '__llvm_libc_21_0_0_git'; did you mean simply 'getc'?
   38 |   return LIBC_NAMESPACE::getc(reinterpret_cast<::FILE *>(f));
      |          ^~~~~~~~~~~~~~~~~~~~
      |          getc
<command line>:1:24: note: expanded from macro 'LIBC_NAMESPACE'
    1 | #define LIBC_NAMESPACE __llvm_libc_21_0_0_git
      |                        ^
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf_core/reader.h:37:17: note: 'getc' declared here
   37 | LIBC_INLINE int getc(void *f) {
      |                 ^
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf_core/reader.h:42:3: error: no member named 'ungetc' in namespace '__llvm_libc_21_0_0_git'; did you mean simply 'ungetc'?
   42 |   LIBC_NAMESPACE::ungetc(c, reinterpret_cast<::FILE *>(f));
      |   ^~~~~~~~~~~~~~~~~~~~~~
      |   ungetc
<command line>:1:24: note: expanded from macro 'LIBC_NAMESPACE'
    1 | #define LIBC_NAMESPACE __llvm_libc_21_0_0_git
      |                        ^
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf_core/reader.h:41:18: note: 'ungetc' declared here
   41 | LIBC_INLINE void ungetc(int c, void *f) {
      |                  ^
2 errors generated.
0.692 [386/33/281] Generating /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa/llvm-libc-decls/math.h
0.693 [386/32/282] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_one_uc.dir/stdc_first_leading_one_uc.cpp.o
0.696 [386/31/283] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o
FAILED: libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o 
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc -isystem /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa -O3 -DNDEBUG --target=amdgcn-amd-amdhsa -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)" -fpie -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -nogpulib -fvisibility=hidden -fconvergent-functions -flto -Wno-multi-gpu -Xclang -mcode-object-version=none -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -DLIBC_COPT_SCANF_DISABLE_FLOAT -DLIBC_COPT_SCANF_DISABLE_INDEX_MODE -MD -MT libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o -MF libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o.d -o libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o -c /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/fscanf.cpp
In file included from /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/fscanf.cpp:14:
In file included from /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf_core/vfscanf_internal.h:16:
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/stdio/scanf_core/reader.h:38:10: error: no member named 'getc' in namespace '__llvm_libc_21_0_0_git'; did you mean simply 'getc'?
   38 |   return LIBC_NAMESPACE::getc(reinterpret_cast<::FILE *>(f));
      |          ^~~~~~~~~~~~~~~~~~~~
      |          getc
<command line>:1:24: note: expanded from macro 'LIBC_NAMESPACE'
    1 | #define LIBC_NAMESPACE __llvm_libc_21_0_0_git
      |                        ^

```

</details>

https://github.com/llvm/llvm-project/pull/121215


More information about the libc-commits mailing list