[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Infinite recursion with fopen
From: |
Michael Goffioul |
Subject: |
Re: Infinite recursion with fopen |
Date: |
Sun, 28 Aug 2011 00:17:52 +0100 |
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)
I assume the same problem will occur in "open" module.
Michael.
[1] http://msinttypes.googlecode.com/svn/trunk/stdint.h
On Sun, Aug 28, 2011 at 12:01 AM, Michael Goffioul
<address@hidden> wrote:
> Hi,
>
> When compiling octave with MSVC, I found an infinite recursion problem
> with fopen. As fopen.c is compiled in C mode and GNULIB_FOPEN and
> REPLACE_FOPEN are both 1 on my setup, it is compiled with
> "fopen" being redefined as "rpl_open". This means that orig_fopen will
> end up calling rpl_fopen (and not the system fopen, as I think it's supposed
> to be). And because rpl_fopen calls orig_fopen, you get an infinite
> recursion.
>
> I'm not sure how this is supposed to work. I understand that #undef'ining
> "fopen" is not an option as the system version might also be defined
> as a macro on some systems.
>
> Michael.
>