running
Code:
make all-gcc
outputs a lot of warnings (over 100) all saying:

Quote:
warning: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]


Is this fine and can I just ignore it or did I do anything wrong, thanks Smile
No you cannot "ignore warnings" - they mean your code is wrong.
The missing context here (based on my knowledge of the rule all-gcc) is that Michael is compiling GCC and this isn't their code.

Warnings often indicate there's a problem with the code you're building and in general should be fixed, but (especially if you didn't write the code) they can often be ignored without ill effect. I suspect you're building an old version of GCC and using a newer version would be better all around, both in not causing these warnings and in general being a better compiler.
MichaelY wrote:
warning: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]


Bruh, it literally tells you what the problem is! You are declaring an array of size 1 and you are indexing the second offset! Arrays (in whatever language you are using) are initialized by type array_name[size];. However the first offset is actually indexed by doing array_name[0];. I can clearly tell that what you tried to do is declare an array of size 1 (although why not just declare a variable instead?!?) and then tried to do array_name[1]; which attempts to access the SECOND offset in an array of size 1. Naturally the compiler is going to scream like a wet cat. I'm actually surprised that it didn't through you an error but only a warning.
ProgrammerBobSmith wrote:
Bruh, it literally tells you what the problem is! You are declaring an array of size 1 and you are indexing the second offset!
I can tell you didn't read or bother to understand my comment; they are not building code they wrote. Yes there are probably quality issues in that code, but they're probably fixed in newer versions (which I strongly recommend using).

I expect the resulting program will will work okay simply because the case is probably that the newer GCC they're using to build GCC with has added the ability to warn about whatever error-prone style the old compiler uses, but hasn't changed the underlying code generation behavior to any significant extent.
Thank you all for your replies but turns out I did something wrong while setting up the GCC, so I just scrapped everything and redid the process which ended up working, thanks though Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement