Operating System - OpenVMS
1753345 Members
4999 Online
108792 Solutions
New Discussion юеВ

Re: stat.h and __USING_STD_STAT : bug or feature?

 
SOLVED
Go to solution
Jansen_8
Regular Advisor

stat.h and __USING_STD_STAT : bug or feature?

Hi All,

The small program below compiled with HP C++ V7.3-009 for OpenVMS Alpha V8.4 gives a whole bunch of errors. Is this a bug or I am doing something that is not allowed?

#define __USING_STD_STAT 1
#include

main()
{}



Error log:
typedef __dev_t dev_t;
................^
%CXX-E-UNDECLARED, identifier "__dev_t" is undefined
at line number 66 in module STAT of text library SYS$COMMON:[SYSLIB]DECC$RTLDEF.
TLB;1

typedef __ino_t ino_t;
................^
%CXX-E-UNDECLARED, identifier "__ino_t" is undefined
at line number 71 in module STAT of text library SYS$COMMON:[SYSLIB]DECC$RTLDEF.
TLB;1

__dev_t st_dev; /* device id */
....^
%CXX-E-UNDECLARED, identifier "__dev_t" is undefined
at line number 171 in module STAT of text library SYS$COMMON:[SYSLIB]DECC$RTLDEF
.TLB;1

__ino_t st_ino; /* file number */
....^
%CXX-E-UNDECLARED, identifier "__ino_t" is undefined
at line number 172 in module STAT of text library SYS$COMMON:[SYSLIB]DECC$RTLDEF
.TLB;1

__dev_t st_rdev;
....^
%CXX-E-UNDECLARED, identifier "__dev_t" is undefined
at line number 178 in module STAT of text library SYS$COMMON:[SYSLIB]DECC$RTLDEF
.TLB;1

blksize_t st_blksize; /* filesystem-specific preferred I/O block size for
this file */
....^
%CXX-E-UNDECLARED, identifier "blksize_t" is undefined
at line number 191 in module STAT of text library SYS$COMMON:[SYSLIB]DECC$RTLDEF
.TLB;1

blkcnt_t st_blocks; /* number of blocks allocated for this file */
....^
%CXX-E-UNDECLARED, identifier "blkcnt_t" is undefined
at line number 192 in module STAT of text library SYS$COMMON:[SYSLIB]DECC$RTLDEF
.TLB;1

%CXX-I-MESSAGE, 7 errors detected in the compilation of "$DISK7:[joukj.TEST]TEST
.CXX;15".
4 REPLIES 4
Steven Schweda
Honored Contributor
Solution

Re: stat.h and __USING_STD_STAT : bug or feature?

> [...] I am doing something that is not
> allowed?

> #define __USING_STD_STAT 1

Try:

#define _USE_STD_STAT

Read more carefully. :

/*
** This is the beginning of the standard stat structure definition.
** It is in effect if feature macro _USE_STD_STAT is defined.
*/

:

/*
** _USE_STD_STAT: The new standardized stat structure takes the place of
** all prior versions, if you compile with _USE_STD_STAT defined.
*/

Some macros are for your use, some are not.
Jansen_8
Regular Advisor

Re: stat.h and __USING_STD_STAT : bug or feature?

Thanks Steven,

That solves the problem.
You are right I should have read more carefully.

Jouk
WW304289
Frequent Advisor

Re: stat.h and __USING_STD_STAT : bug or feature?

If you look at how __USING_STD_STAT macro is defined in , you'll see that this macro is unnecessary: the header defines __USING_STD_STAT macro if _USE_STD_STAT macro is defined and does not define it otherwise, so __USING_STD_STAT is just an "alias" to _USE_STD_STAT.

The (internal) macro __USING_STD_STAT which is often mistaken for the (public) macro _USE_STD_STAT shouldn't have been introduced in the first place, I believe.

Thanks,
-Boris
Steven Schweda
Honored Contributor

Re: stat.h and __USING_STD_STAT : bug or feature?

> [...] so __USING_STD_STAT is just an
> "alias" to _USE_STD_STAT.

Obviously not, or the original code would
have worked.


> If you look [...]

Look yourself?