[sr #110393] Unconditional include of stdio.h should be avoided

2020-12-06 Thread anonymous
URL:
  

 Summary: Unconditional include of stdio.h should be avoided
 Project: Autoconf
Submitted by: None
Submitted on: Sun 06 Dec 2020 11:39:26 AM UTC
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: kotovalexar...@gmail.com
 Open/Closed: Open
 Discussion Lock: Any
Operating System: None

___

Details:

I'm building my library with cross-compiler without stdlib, so only several
headers are present (stdbool.h, stddef.h, stdarg.h, etc). Header stdio.h is
not present. However, it's used unconditionally in AC_CHECK_HEADER_STDBOOL and
AC_CHECK_HEADERS, so I receive the following output:

> checking for _Bool... no
> checking stddef.h usability... no
> checking stddef.h presence... yes
> configure: WARNING: stddef.h: present but cannot be compiled
> configure: WARNING: stddef.h: check for missing prerequisite headers?
> configure: WARNING: stddef.h: see the Autoconf documentation
> configure: WARNING: stddef.h: section "Present But Cannot Be Compiled"
> configure: WARNING: stddef.h: proceeding with the compiler's result
> configure: WARNING: ##
 ##
> configure: WARNING: ## Report this to
https://github.com/kernelmq/libkernaux/issues ##
> configure: WARNING: ##
 ##
> checking for stddef.h... no

config.log explains why checks fail:

> configure:5777: checking for _Bool
> configure:5777:
/home/kotovalexarian/repos/github/kernelmq/kernelmq/vendor/crosscompiler/bin/i686-elf-gcc
-c -ffreestanding -nostdlib -fno-builtin -fno-stack-protector  conftest.c >&5
> conftest.c:16:10: fatal error: stdio.h: No such file or directory
>  #include 
>   ^
> compilation terminated.
> configure:5777: $? = 1
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "libkernaux"
> | #define PACKAGE_TARNAME "libkernaux"
> | #define PACKAGE_VERSION "0.0.0"
> | #define PACKAGE_STRING "libkernaux 0.0.0"
> | #define PACKAGE_BUGREPORT "https://github.com/kernelmq/libkernaux/issues";
> | #define PACKAGE_URL "https://github.com/kernelmq/libkernaux";
> | #define ARCH_X86 1
> | #define ENABLE_CMDLINE 1
> | #define ENABLE_CONSOLE 1
> | #define ENABLE_MULTIBOOT2 1
> | #define ENABLE_PFA 1
> | #define PACKAGE "libkernaux"
> | #define VERSION "0.0.0"
> | /* end confdefs.h.  */
> | #include 
> | #ifdef HAVE_SYS_TYPES_H
> | # include 
> | #endif
> | #ifdef HAVE_SYS_STAT_H
> | # include 
> | #endif
> | #ifdef STDC_HEADERS
> | # include 
> | # include 
> | #else
> | # ifdef HAVE_STDLIB_H
> | #  include 
> | # endif
> | #endif
> | #ifdef HAVE_STRING_H
> | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
> | #  include 
> | # endif
> | # include 
> | #endif
> | #ifdef HAVE_STRINGS_H
> | # include 
> | #endif
> | #ifdef HAVE_INTTYPES_H
> | # include 
> | #endif
> | #ifdef HAVE_STDINT_H
> | # include 
> | #endif
> | #ifdef HAVE_UNISTD_H
> | # include 
> | #endif
> | int
> | main ()
> | {
> | if (sizeof (_Bool))
> |  return 0;
> |   ;
> |   return 0;
> | }
> configure:5777: result: no



___

File Attachments:


---
Date: Sun 06 Dec 2020 11:39:26 AM UTC  Name: config.log  Size: 86KiB   By:
None



___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110393] Unconditional include of stdio.h should be avoided

2020-12-06 Thread Zack Weinberg
Update of sr #110393 (project autoconf):

  Status:None => Ready For Test 

___

Follow-up Comment #1:

Nice catch; we have never really tested Autoconf with compilers for
freestanding environments.  I can't guarantee that Autoconf 2.70 will work
100% for you, but this specific problem should be addressed by commits
b045574cb2ea1c8441be7a7b56fd471d704ebf3a and
131d8c69f31dc6fc8dc93abe1096d52d1fe19fd3.

Before I close the bug report, I'd appreciate it if you could re-test autoconf
git trunk in your environment.  Autoconf's own test suite will probably not
run cleanly, but your library's configure script should work much better.

(See https://savannah.gnu.org/git/?group=autoconf for instructions for
accessing autoconf git trunk, and README-hacking in the source tree for how to
build it.)

(If you find more, different problems, please report them as separate bugs.  I
cannot promise to get them fixed for 2.70, which is being released in two days
no matter what, but at least we will have them on record.)

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110393] Unconditional include of stdio.h should be avoided

2020-12-06 Thread anonymous
Follow-up Comment #2, sr #110393 (project autoconf):

I've tested your changes. Everything works right now. Thank you. The bug
report can be closed as solved.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110393] Unconditional include of stdio.h should be avoided

2020-12-06 Thread Zack Weinberg
Update of sr #110393 (project autoconf):

  Status:  Ready For Test => Done   
 Open/Closed:Open => Closed 

___

Follow-up Comment #3:

Thanks for testing so quickly.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/