Pro*C: C Compiler Error "Operand Must Be A Scalar Type." Using Leading Zero "0" Like Varchar Xxx[09] (Doc ID 1093694.1)

Last updated on MAY 04, 2010

Applies to:

Precompilers - Version: 11.2.0.1 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms

Using Pro*C and building application containing definitions like

    VARCHAR hst_msg_send_date[08]; 
    VARCHAR hst_msg_send_date[09];

generates wrong C/C++ code so that 8 or 9 following the 0 get removed:

/* VARCHAR hst_msg_send_date_8[08]; */
struct { unsigned short len; unsigned char arr[0]; } hst_msg_send_date_8;

/* VARCHAR hst_msg_send_date_9[09]; */
struct { unsigned short len; unsigned char arr[0]; } hst_msg_send_date_9;

On AIX this will cause compilation error from C Compiler like
   
"Operand must be a scalar type."

While on other platforms the compiler does not detect the wrong generated code (GCC / Linux)

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms