[libc-commits] [libc] [libc] Refactor scanf reader to match printf (PR #66023)

Siva Chandra via libc-commits libc-commits at lists.llvm.org
Fri Sep 22 11:23:33 PDT 2023


================
@@ -220,6 +220,20 @@ add_libc_test(
     libc.src.stdio.vprintf
 )
 
+
+if(LLVM_LIBC_FULL_BUILD)
+  # In fullbuild mode, fscanf's tests use the internal FILE for other functions.
+  list(APPEND fscanf_test_deps
+       libc.src.stdio.fclose
+       libc.src.stdio.ferror
+       libc.src.stdio.fopen
+       libc.src.stdio.fwrite
+  )
+else()
+# Else in overlay mode they use the system's FILE.
+ set(fscanf_test_copts "-DLIBC_COPT_SCANF_USE_SYSTEM_FILE")
----------------
sivachandra wrote:

This opt should likely be named as `LIBC_COPT_STDIO_USE_SYSTEM_FILE` and shared between `printf`, `scanf` and all other stdio pieces which can work with both system file or libc's own file.

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


More information about the libc-commits mailing list