473,811 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

warning: use of C99 long long integer constant

Hi,

Unfortunately, I don't find lots of information on this warning. It
occurs if I compile with -pedantic but I am not sure how I can resolve
this problem. Do you have an idea?

The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}

Regards and thanks a lot,
Sebastian
Apr 1 '08 #1
21 8388
On Apr 1, 8:39 am, Sebastian Faust <sebastian.fa.. .@googlemail.co m>
wrote:
Hi,

Unfortunately, I don't find lots of information on this warning. It
occurs if I compile with -pedantic but I am not sure how I can resolve
this problem. Do you have an idea?

The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}

Regards and thanks a lot,
Sebastian
You neglected to post the warning. However, I'm surprised you don't
get an error since you try to initialize an array of 1 with two
values.
-Jul
Apr 1 '08 #2
Sebastian Faust wrote:
Hi,

Unfortunately, I don't find lots of information on this warning. It
occurs if I compile with -pedantic but I am not sure how I can resolve
this problem. Do you have an idea?

The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}
Aside from the warning (which Ben Bacarisse has explained), note that
you are trying to initialize an array of size 1 with two members.

Please quote the warning in the message as well as the subject.

Philip
Apr 1 '08 #3
Hi,

Thanks! it works! It was just a copy&paste typo... I copied the
relevant code and then I made this typo...

Thanks again,
Sebastian
Apr 1 '08 #4
Hi,

Btw. is there a possibility to get rid of this warning with some sort
of typecast?

Regards,
Sebastian

On 1 Apr., 15:03, Philip Potter <p...@doc.ic.ac .ukwrote:
Sebastian Faust wrote:
Hi,
Unfortunately, I don't find lots of information on this warning. It
occurs if I compile with -pedantic but I am not sure how I can resolve
this problem. Do you have an idea?
The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}

Aside from the warning (which Ben Bacarisse has explained), note that
you are trying to initialize an array of size 1 with two members.

Please quote the warning in the message as well as the subject.

Philip
Apr 1 '08 #5
Hey guys,

Could you please tell me if there is any way to get rid of this
warning by applying some typecast?

Cheers,
Sebastian

On 1 Apr., 14:39, Sebastian Faust <sebastian.fa.. .@googlemail.co m>
wrote:
Hi,

Unfortunately, I don't find lots of information on this warning. It
occurs if I compile with -pedantic but I am not sure how I can resolve
this problem. Do you have an idea?

The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}

Regards and thanks a lot,
Sebastian


Apr 1 '08 #6
[Top-posting corrected]
Sebastian Faust <se************ *@googlemail.co mwrites:
On 1 Apr., 15:03, Philip Potter <p...@doc.ic.ac .ukwrote:
>Sebastian Faust wrote:
Hi,
Unfortunately, I don't find lots of information on this warning. It
occurs if I compile with -pedantic but I am not sure how I can resolve
this problem. Do you have an idea?
The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}

Aside from the warning (which Ben Bacarisse has explained), note that
you are trying to initialize an array of size 1 with two members.

Please quote the warning in the message as well as the subject.
<snip>
Btw. is there a possibility to get rid of this warning with some sort
of typecast?
Did you read my message? Was that not the problem?

--
Ben.
Apr 1 '08 #7
On 1 Apr., 16:16, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
[Top-posting corrected]

Sebastian Faust <sebastian.fa.. .@googlemail.co mwrites:
On 1 Apr., 15:03, Philip Potter <p...@doc.ic.ac .ukwrote:
Sebastian Faust wrote:
Hi,
Unfortunately, I don't find lots of information on this warning. It
occurs if I compile with -pedantic but I am not sure how I can resolve
this problem. Do you have an idea?
The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}
Aside from the warning (which Ben Bacarisse has explained), note that
you are trying to initialize an array of size 1 with two members.
Please quote the warning in the message as well as the subject.
<snip>
Btw. is there a possibility to get rid of this warning with some sort
of typecast?

Did you read my message? Was that not the problem?

--
Ben.
Yes that solved the problem, but I cannot change the option how the
program is compiled. So, is there a way to change the sourcecode?
Although I am not sure if this is actually a good approach...

Cheers,
Sebastian
Apr 1 '08 #8
Sebastian Faust <se************ *@googlemail.co mwrites:
On 1 Apr., 16:16, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
>Sebastian Faust <sebastian.fa.. .@googlemail.co mwrites:
On 1 Apr., 15:03, Philip Potter <p...@doc.ic.ac .ukwrote:
Sebastian Faust wrote:
<snip>
Unfortunately, I don't find lots of information on this
warning.
<snip>
The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}
<snip>
>Did you read my message? Was that not the problem?

--
Ben.
Best not to quote sigs.
Yes that solved the problem, but I cannot change the option how the
program is compiled. So, is there a way to change the sourcecode?
Although I am not sure if this is actually a good approach...
Ah, then you are in trouble, since you are compiling C99 with a
compiler that is expecting something else.

In such a situation I would not want to turn off the warnings. I'd
want then all and I'd keep checking that none of them was indicating a
more serious problem.

--
Ben.
Apr 1 '08 #9
On 1 Apr., 16:30, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
Sebastian Faust <sebastian.fa.. .@googlemail.co mwrites:
On 1 Apr., 16:16, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
Sebastian Faust <sebastian.fa.. .@googlemail.co mwrites:
On 1 Apr., 15:03, Philip Potter <p...@doc.ic.ac .ukwrote:
Sebastian Faust wrote:
<snip>
Unfortunately, I don't find lots of information on this
warning.
<snip>
The following code produces the warning:
const static unsigned long long data[1] = {
0x428a2f98d728a e22ULL, 0x7137449123ef6 5cdULL}
<snip>
Did you read my message? Was that not the problem?
--
Ben.

Best not to quote sigs.
Yes that solved the problem, but I cannot change the option how the
program is compiled. So, is there a way to change the sourcecode?
Although I am not sure if this is actually a good approach...

Ah, then you are in trouble, since you are compiling C99 with a
compiler that is expecting something else.
Ok! Thanks! Is there a way to solve these particular warnings (use of
C99 long long...) with some change in the code? The reason for this is
that there are hundreds of these warnings and I don't wanna frustrate
the guy who has to compile the code.

Cheers,
Sebastian
Apr 1 '08 #10

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

Similar topics

7
17207
by: Jeff Gilchrist | last post by:
I have tried searching the newsgroup along with the GCC site and could not find what I think is probably a simple solution. I am using a 64bit unsigned long long integer and can manipulate 64bits within the variable but I cannot assign a 64bit constant to it. With my simple test program: int main() {
4
17885
by: mimmo | last post by:
Hi! I should convert the accented letters of a string in the correspondent letters not accented. But when I compile with -Wall it give me: warning: multi-character character constant Do the problem is the charset? How I can avoid this warning? But the worst thing isn't the warning, but that the program doesn't work! The program execute all other operations well, but it don't print the converted letters: for example, in the string...
29
15683
by: SysSpider | last post by:
Hi again, This is my problem: when i try to compile the code that contains the function below, i get this: -- gcc:21: error: case label does not reduce to an integer constant gcc:24: error: case label does not reduce to an integer constant --
6
35678
by: fctk | last post by:
hello, i'm trying to compile this small program: int main(void) { unsigned long int max; max = 4000000000;
17
2353
by: jithoosin | last post by:
Hi, Why is the code not getting compiled ? I am using SuSe linux. Is it becuase of that ? #include<stdio.h> int main() { long long i; i = LL 9876543219; printf("%ld\n", i);
10
10722
by: krunalb | last post by:
Hi, I am trying to shift unsigned long long value by 64 bits and this is what i get #include <stdio.h> int main() { unsigned short shiftby= 64;
3
2991
by: wolverine | last post by:
Hi, I compiled the following code int main() { long long a = 0x7ff0000000000000L; } I got error "test.cpp:3: error: integer constant is too large for
7
7541
by: Jo Deni | last post by:
Folks, I'm a newbie here (and with C++). While executing a C++ program I'm getting the following message error: integer constant is too large for "long" type and here is the offending line in my code double X = 10000000000;
0
9730
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10403
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4341
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 we have to send another system
3
3020
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.