WSIZEOF | NOWSIZEOF

Category

Object code control

Pragma equivalent

#pragma wsizeof(on)

Purpose

Causes the sizeof operator to return the widened size for function return types.

When the WSIZEOF compiler option is in effect, sizeof returns the size of the widened type for function return types instead of the size of the original return type.

When the NOWSIZEOF compiler option is in effect, sizeof returns the size of the original return type.

Syntax

Read syntax diagramSkip visual syntax diagram
   .-NOWSIZEOF-.   
>>-+-WSIZEOF---+-----------------------------------------------><

Defaults

NOWSIZEOF

Usage

When the sizeof operator was applied to a function return type using the WSIZEOF compiler option, earlier C and C++ compilers (prior to and including C/C++ for IBM® MVS™ Version 3 Release 1) returned the size of the widened type instead of the original type. For example, if the following code fragment, was compiled with an earlier compiler, i would have a value of 4.
char foo();
i = sizeof foo();

Using the z/OS® XL C/C++ compiler, i has a value of 1, which is the size of the original type char.

The WSIZEOF compiler option toggles the behavior of the sizeof operator between that of the C and C++ compilers prior to and including C/C++ MVS Version 3 Release 1, and z/OS XL C/C++.

Predefined macros

None.