473,396 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

lcc compiler bug report

Can anyone tell me why, if the following code is legal, in lcc the first initialization is performed well, but the second one not ?

int a= 1; int adress_of_a= (int) &a;
---> this works fine, adress_of_a is initialized with 0x0040....


int a= 1; int adress_of_a[1]= { (int) &a };
---> this does not work, adress_of_a is initialized with 00000000.

Thank you for your reply !

Lucien MATHAY
Jun 6 '12 #1
2 1872
weaknessforcats
9,208 Expert Mod 8TB
This is an array:

Expand|Select|Wrap|Line Numbers
  1. int adress_of_a[1];
When you display the name of an array you display the address of the array. You need to display adress_of_a[0] to display the result of your cast.
Jun 6 '12 #2
Thank you for your reply, I understand it.
Actually the question is more : whether this is a bug or not in LCC compiler, and in this subject we have advanced in another discussion group. See on the comp.compilers.lcc on google groups if you are interested further.

Otherwise, thank you for the time you spent in answering this question, I appreciate !
Jun 8 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

30
by: Neil Zanella | last post by:
Hello, Allow me to share my frustrations with GNU g++. This is the second time something similar happens to me: I can't find anything wrong with my C++ program and yet I get segfaults, and...
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
2
by: Mythran | last post by:
In .Net, how can I go about and set a Crystal Reports namespace? Right now they use the Root Namespace (VB) from the project. How can I extend the namespace for a single report (which will be set...
19
by: Jerry | last post by:
I managed to narrow this down to a very simple expression. try this: private void Bug() { bool b = false; Test(3, (b || b) && b && !b); } private void Works() {
3
by: Benedikt Weber | last post by:
I found the following compiler error with Microsoft Visual C++ .NET. I use different functions with return types determined by a Traits class. Function g() below works ok, but when I put the two...
1
by: reom | last post by:
Hi, I'm not sure this is the right place to report bugs in MS Visual C++ .NET 2003. I posted the same message on MSDN forums (http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=95745). In...
10
by: chris | last post by:
I'm not sure if this is a bug being caused by visual studio, or by the vb compiler itself. I have good size solution (33 projects) and am consistently having a problem with one project.. ...
13
by: murphman | last post by:
I recently decided to do the right thing & write accessor functions for my class member variables instead of having them public and introduced a rather nasty bug. The class below shows the error -...
0
by: Madhu Subramanya | last post by:
I have a Crystal Report 10 report which i need to use in my app. I use Managed solution for this. There are no compiler or linker problems. I am not able to display this report on the screen but am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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,...

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.