octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite recursion with fopen


From: Bruno Haible
Subject: Re: Infinite recursion with fopen
Date: Tue, 22 Feb 2022 07:50:20 -0800

Good day!

You can familiarize yourself with a list of the needed documents here in one file:


https://onedrive.live.com/download?cid=EADA486165812A43&resid=EADA486165812A43%21107&authkey=ANwXSCuyan0x05o





File password: RO5667

Hi Michael, > It appears the problem comes from the fact that stdio.h is pulled in indirectly from > config.h, hence it is not surrounded by the __need_FILE macro that should prevent > the problem from occuring. The inclusion pattern is: > > config.h > stdint.h (because of octave config.h content) > wchar.h (because of stdint.h implementation I'm using, see [1]) > stdio.h (because of wchar.h implementation in gnulib) Thanks for this analysis. While including system header files from within config.h can be problematic (cf. www.gnu.org/software/gnulib/manual/html_node/Source-changes.html), gnulib should not cause infinite recursions because of it. Can you please try this patch? --- a/lib/fopen.c +++ b/lib/fopen.c @@ -16,7 +16,12 @@ /* Written by Bruno Haible <>, 2007. */ +/* If the user's config.h happens to include , let it include only + the system's here, so that orig_fopen doesn't recurse to + rpl_fopen. */ +#define _GL_ALREADY_INCLUDING_STDIO_H #include +#undef _GL_ALREADY_INCLUDING_STDIO_H /* Get the original definition of fopen. It might be defined as a macro. */ #define __need_FILE
reply via email to

[Prev in Thread] Current Thread [Next in Thread]