NO

Author Topic: tchar.h: _tfreopen() maps to unknown function reopen() _UNICODE not defined  (Read 2322 times)

Offline Fuerst

  • Member
  • *
  • Posts: 2
Pelles C 11.00.2
Code to reproduce ...

#undef _UNICODE
#include <stdio.h>
#include <wchar.h>
#include <tchar.h>

int _tmain( void ) {
   FILE *f = _tfreopen(_T("NUL:"), _T("w"), stdout);
   return 0;
}

Compiler-Output

> > pocc.exe -Tx64-coff -std:C99 -Ob1 -fp:precise -W2 -Gd -Go -GX "O:\Sources\test64\test64.c" -Fo"O:\Sources\test64\output\test64.obj"
O:\Sources\test64\test64.c(7): warning #2018: Undeclared function 'reopen' (did you mean: freopen?); assuming 'extern' returning 'int'.
O:\Sources\test64\test64.c(7): error #2082: Invalid initialization type; expected 'FILE (aka (incomplete) struct FILE) *' but found 'int'.
O:\Sources\test64\test64.c(7): error #2168: Operands of '=' have incompatible types 'FILE (aka (incomplete) struct FILE) *' and 'int'.
*** Error code: 1 ***
Done.

tchar.h Line 360

/* file access */
#define _tfdopen  _fdopen  /* 05-07-18 */
#define _tfopen  fopen  /* 05-07-18 */
#define _tfreopen  reopen  /* 05-07-18 */  <<< Line 360

I think, there simply is the letter "f" missing in front of "reopen" (The Help-File is  affected although) ...

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
I think, there simply is the letter "f" missing in front of "reopen" (The Help-File is  affected although) ...

Me too...  ;)
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Yup.
/Pelle