C long long HP-UX

I have a program written in C on HP-UX 11i. The program is as
below ...
long long a;
a = 12345678987654321;
printf ("%lld",a);

I compile the code using cc compiler on HP-UX using
-Ae +DD32 option as i want it to create a 32-bit binary.
But the output of this program is not correct. But as per the
man page of cc compiler it says that with the option
-Ae +DD32 it supports 64 bit value for long long.

Now if i change the code as below
long long a;
scanf("%lld",&a);
printf ("%lld",a);

and i compile it wiith the same options and manually give this
value 12345678987654321 it works.

( Both the above code work fine with aCC -Ae +DD32 option
but i dont want to use aCC compiler)

Pls help me out in this to explain the absurd behaviour...

Thanx in advance ...............

HP-UX comes with a bundled cc compiler but it doesn't have many options and can only handle old K&R C (as opposed to Ansi C). It has no man page and is largely unsupported. HP needs it to build the kernel so they can't get rid of it.

The man page that you are reading is from the Ansi C compiler which is a separate product. You must have /opt/ansic/share/man in your MANPATH or maybe your local admins moved the man page or something.

But you are using /usr/bin/cc when you need to use /opt/ansic/bin/cc instead. Adjust your PATH or use an alias or something.

I have a question for you now, why do you not want to use aCC? Actually, when I write C code, I like to compile with a c++ compiler anyway. It does more checking which I like.