473,509 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem in unsigned long long

hi,
My code having unsigned long long int64_t;
like that.. compile error message is long followed by long is
illegal,
what is the reason for it?

Apr 9 '07 #1
9 6407
On Apr 9, 9:37 am, vadivel...@gmail.com wrote:
hi,
My code having unsigned long long int64_t;
like that.. compile error message is long followed by long is
illegal,
what is the reason for it?
Probably, you are not using a C99-compliant compiler.

Prior to C99, long long was not a standard data type, and instead was
an extension that /some/ compilers provided. Apparently, your compiler
is one that did not implement this non-standard (wrt pre-C99
standards) data type.

Apr 9 '07 #2
Thaks for immediate reply...

how to convert unsigned long long int64_t for gcc
compiler

Apr 9 '07 #3
va********@gmail.com wrote:
how to convert unsigned long long int64_t for gcc
compiler
What compiler flags are you using, which version of gcc, which platform?

You may have specified some combination that prevents gcc from
recognizing "long long" as a valid type. Make a tiny example program
and try compiling it with

gcc -std=c99 example example.c

For any fairly recent gcc on most platforms that should handle long long
types correctly.

Regards,

David Mathog
Apr 9 '07 #4
va********@gmail.com wrote:
Thaks for immediate reply...

how to convert unsigned long long int64_t for gcc
compiler
Current versions of gcc support unsigned long long and current versions
of libraries supplied with gcc have the header <stdint.hwith int64_t
defined there. If you upgrade to a current version of gcc and supplied
libraries, remove the typedef for int64_t from your code and add
#include <stdint.hto the top of your code.

Otherwise, if you continue to use a (very) old version of gcc without
long long, then you have no type available for int64_t. You can, of
course, lie and
typedef unsigned long int64_t;
but that is not recommended.

It is possible that you are compiling with flags that disable
recognition of long long. 'long long' is not in ISO C90, so compilation
with -std=c89 or its equivalent -ansi _may_ disable recognition of long
long. gcc will, unless told to treat warnings as errors, properly
handle long long but emit warnings. You want to use -std=c99.

If you are compiling without specifying the -std, your copy of gcc will
compile a language very much like C, but not quite. The version of the
nonstandard 'GNU C' language chosen will probably be -std=gnu89, which
will generate diagnostics for long long. For posting to comp.lang.c,
you always want to specify a version of standard C, -ansi or -std=c90
for the old standard, -std=c99 for an attempt at conforming to the new
standard. _Never_ post code for which GNU C is the language used, and
since not specifying a standard is the same as -std=gnu89, that is to be
avoided.
Apr 9 '07 #5
On 9 Apr 2007 06:52:50 -0700, va********@gmail.com wrote:
>Thaks for immediate reply...

how to convert unsigned long long int64_t for gcc
compiler
Your code is very likely to have something like

typedef unsigned long long int64_t;

Since your question is related to a specific compiler, you have to try
a compiler specific newsgroup. You might want to try gnu.gcc.help GCC
also has mailing lists which might be helpful.

<OT>
GCC version 3.2.2 (around four years old) supports unsigned long long.
It complains only when invoked in c89 mode.
</OT>

Have a nice day,
Pradeep
--
All opinions are mine and do not represent the views or
policies of my employer.
R Pradeep Chandran rpc AT pobox DOT com
Apr 9 '07 #6
On Apr 9, 6:37 am, vadivel...@gmail.com wrote:
>
My code having unsigned long long int64_t;
Why? What's it supposed to mean? How is int64_t defined? Do you have
<stdint.hincluded? Are you compiling in a C99-conformant (or close)
mode or something else?
like that.. compile error message is long followed by long is
illegal, what is the reason for it?
That depends on the answers to the questions above.
Apr 9 '07 #7
va********@gmail.com writes:
My code having unsigned long long int64_t;
like that.. compile error message is long followed by long is
illegal,
You have what?

If you have a declaration

unsigned long long int64_t;

then you're declaring an object "in64_t" of type "unsigned long long".
That's a bad idea, since "int64_t" is used in C99 as a type name, not
an object name.

Show us the *exact* code you're trying to compile.

If you have <stdint.h>, then you should already have a typedef for
"int64_t", and you don't need to declare it yourself. If your
compiler, in whatever mode you're invoking it in, doesn't support type
"unsigned long long", then you won't be able to use "unsigned long
long" unless you use a different compiler, or the same compiler in a
different mode.

gcc comes with extensive documentation. Try "info gcc".

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Apr 9 '07 #8
David Mathog <ma****@caltech.eduwrites:
va********@gmail.com wrote:
>how to convert unsigned long long int64_t for gcc
compiler

What compiler flags are you using, which version of gcc, which platform?

You may have specified some combination that prevents gcc from
recognizing "long long" as a valid type. Make a tiny example program
and try compiling it with

gcc -std=c99 example example.c

For any fairly recent gcc on most platforms that should handle long long
types correctly.
<OT>

I think you mean either
gcc -std=c99 example.c -o example
or
gcc -std=c99 -c example.c
The latter doesn't attempt to invoke the linker to create an
executable, but it will catch compile-time errors.
</OT>

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Apr 9 '07 #9
<va********@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
Thaks for immediate reply...

how to convert unsigned long long int64_t for gcc
compiler
GCC has supported "unsigned long long" for many years; if you're not using a
version that understands it, you really need to upgrade.

That makes me wonder, though, what the actual code you're trying to use
looks like. Can you post a compilable example and the error messages you
get?

S

--
Stephen Sprunk "Those people who think they know everything
CCIE #3723 are a great annoyance to those of us who do."
K5SSS --Isaac Asimov
--
Posted via a free Usenet account from http://www.teranews.com

Apr 9 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2509
by: Faheem Mitha | last post by:
Hi, I'm not sure what would be more appropriate, so I'm ccing it to both alt.comp.lang.learn.c-c++ and comp.lang.python, with followup to alt.comp.lang.learn.c-c++. While working with a...
7
3231
by: Chris Gordon-Smith | last post by:
I have a simulation program that calls the rand() function at various points while it executes. For the user interface that displays statistics etc. while the program runs, I use the Lazarus GUI...
0
3910
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
19
2500
by: Chocawok | last post by:
Some of the classes in my app are graphical. To encapsulate the graphical side of things I had created a class called "sprite" which holds a bit map and knows how to draw itself etc. The...
39
19559
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
19
2194
by: jacob navia | last post by:
I posted this to comp.std.c, but may be of interest here too: Consider this: extern void abort(void); int main (void) { unsigned long long xx; unsigned long long *x = (unsigned long long *)...
3
5797
by: i3x171um | last post by:
To start off, I'm using GCC4. Specifically, the MingW (setjmp/longjmp) build of GCC 4.2.1 on Windows XP x64. I'm writing a class that abstracts a message, which can be either an integer (stored as...
1
2646
by: Alex Vinokur | last post by:
Hi, I have compilation problem on SUN CC compiler with template while using option -m64 (64-bit addressing model). No problem while using option -m32 (32-bit addressing model) $ CC -V CC:...
20
1826
by: @$|-|. DUBEY | last post by:
i have a interger val = 99999; and i want to add the content of val i.e., 9+9+9+9+9 = 45; how to do that.... need urgent help
3
10787
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.