Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

do 'inp' and 'outp' have special meaning to MSVC compiler

Tags:

c

visual-c++

Trying to compile portable c compiler on windows. Compiling some files I get this

C:\work\pcc-revived\pcc\cc\cpp\cpp.h(176): error C2365: 'outp': redefinition; previous definition was 'function'
C:\work\pcc-revived\pcc\cc\cpp\cpp.h(177): error C2365: 'inp': redefinition; previous definition was 'function'

For this. in .h file

typedef char usch;
extern char *pbeg;
extern char  *pend;
extern char *outp;
extern char *inp;

then in c file

pbeg = outp = inp = fb->buf;

I get

..\..\cc\cpp\cpp.c(408): warning C4047: '=': 'int (__cdecl *)()' differs in levels of indirection from 'usch *'
..\..\cc\cpp\cpp.c(408): error C2106: '=': left operand must be l-value

It seems to think that outp and inp are implicitly defined function calls - ie old style foo() without a declaration of foo, treating foo as int foo(void)

I grepped entire include trees of MSVC and windows SDK and cannot find the string outp and inp

I then ran 'cl /E' to get the preprocessor output, and compiled that output, same error (of course) but the string outp and inp do not occur anywhere in the file except for the places I showed above

If I change to outpx and inpx all works fine - confused

EDIT.

I made a very simple test

extern char * inp;
int x(){

  
    return 0;
}

this produces

test.c(1): error C2365: 'inp': redefinition; previous definition was 'function'

compiler

Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33135 for x64
like image 798
pm100 Avatar asked Dec 17 '25 21:12

pm100


1 Answers

It appears these are obsolete functions, removed as of MSVC 2015:

https://learn.microsoft.com/en-us/cpp/c-runtime-library/inp-inpw-inpd?view=msvc-170

https://learn.microsoft.com/en-us/cpp/c-runtime-library/outp-outpw-outpd?view=msvc-170

Important

These functions are obsolete. Beginning in Visual Studio 2015, they are not available in the CRT. This API can't be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported in Universal Windows Platform apps.

Given that nothing of these show up in headers, they most likely exist in the compiler itself as a warning that the functions were removed.

like image 174
dbush Avatar answered Dec 20 '25 07:12

dbush



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!