Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » Community » Coffee corner » important note when a strange compilation error occurs
Re: important note when a strange compilation error occurs [message #57298 is a reply to message #57297] Sun, 27 June 2021 17:49 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 912
Registered: September 2012
Location: Poland, Kraków
Experienced Contributor

According to the standard following line is valid code:
void getTiposCartao(){;

You are opening function scope and add empty instruction. Please noticed that you can place whatever number of semicolons as you want:
void getTiposCartao(){;;;;;;; // <- valid

Why it is so? In C/C++ you are not force to write instruction per line - it is good habbit, but you have flexibility:
void getTiposCartao(){int a = 4;++a;int b = a + 10;for(int i = 0; i < 10; ++i){};;;} // <- You could process universe in the single function ;)

For the readability reason nobody should write code like this... This is not something we could fix within TheIDE. It is how the language is defined.

On the other hand following code:
function abc() };

is invalid due to parenthesis mismatch.

Ultimate++ - one framework to rule them all.

[Updated on: Sun, 27 June 2021 17:52]

Report message to a moderator

Read Message
Read Message
Read Message
Read Message
Previous Topic: Compile under Mac M1 for intel
Next Topic: Do we have a QR image generator?
Goto Forum:

Current Time: Tue Jan 25 06:58:29 CET 2022

Total time taken to generate the page: 0.01410 seconds