C long long HP-UX

Thread Tools Search this Thread
Top Forums Programming C long long HP-UX
# 1  
Old 04-19-2002
Question 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;
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 ...............
# 2  
Old 04-19-2002
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Very long script

Hi! I have to run a very long script. I use a ssh client on Windows in order to connect to a HP-UX box. What I try to avoid is the possibility that the Windows machine reboots or loses the connection to the Unix machine before the script finishes. Somebody told me that xterm could help me. He... (2 Replies)
Discussion started by: Ricardo Vargas
2 Replies

2. Solaris

Filename too long

Hi, I'm trying to tar on Solaris 9 a directory containing very long filename, so tar exit with the error (filename is greater than 100). Is there a way to bypass this limit (I can't realy control filename long)? Regards (3 Replies)
Discussion started by: ncjbdwqer
3 Replies

3. Solaris

word too long

Hello, When I try to run a shell script, It throws an error: $ ./SQLExecute.csh Word too long $ echo $CLASSPATH /u02/installs/calypso/calypsorel90000/jars/ $ echo $PATH... (7 Replies)
Discussion started by: panchpan
7 Replies

4. UNIX for Dummies Questions & Answers

vi.....line too long

I'm getting a "line too long" error when I try to vi a particular file. I really just need to view the contents as I don't have to change anything. Any suggestions?? I already tried to cat but it didnt work........:( (7 Replies)
Discussion started by: shorty
7 Replies

5. UNIX for Advanced & Expert Users

Long string

I have a long string in ASCII file of approx 60k bytes file size. I need to know 1.How many charcters are adjectly in string. export MAX_COL_SIZE=`awk "length>max{max=length}END{print max}" test.txt` this return file cann't open...can anyone advice why?? 2. How many 'TRX consist in my... (1 Reply)
Discussion started by: u263066
1 Replies

6. Shell Programming and Scripting

A very long script.

Hello, I wrote a script, which would ideally take about 480 hours to runs (It has to do a same thing 60 times.) But the problem is I have to use a VPN Client to get to the network before connecting to the machine. The Client automatically closes after 10 hours, closing my console and thus my... (3 Replies)
Discussion started by: sakya_trips
3 Replies

7. Post Here to Contact Site Administrators and Moderators

Long threads?

Greetings, I'm relatively new-comer to these forums and have a Q to the mods. Just wondering what's the policy regarding the long running threads where they tend to go say over 30 posts and they become "troubleshooting" threads rather than being "educational" and/or "hinting" threads? ... (4 Replies)
Discussion started by: vgersh99
4 Replies

8. Programming

long doubles

hey there, i've been trrying to calculate the first 10000 fibonacci numbers using a long double. weird thing is that from a certain value it returns Inf. i'm declaring the vars as long double var; and printing them to a file using: fprintf(filepointer, "%.0Ld\n", var); am i doing... (1 Reply)
Discussion started by: crashnburn
1 Replies

9. UNIX for Dummies Questions & Answers

Arguments too long????

I'm trying to tranfer files via ftp form UNIX to Linux and vice versa. When I tried mget command I received this message: "arguments too long". What should I do to transfer multiple files?????? (2 Replies)
Discussion started by: rrivas
2 Replies
Login or Register to Ask a Question

Featured Tech Videos