GNU issues for cpp

OP #3413771
Rate this post
• ▲ useful
▼ not useful
GCC issue 1:

We are working on the STM32F0 series, where the src code is in C++ and 
the compiler used is the GCC ARM (version 4.4.1) which compiles fine.
However when we changed the GCC compiler to 4.7.3 we are observing 
linker issues as below:
undefined reference to '_isatty'

Can anyone suggest a solution for the same?

*****************************************************

GCC issue 2:

We are working on the STM32F0 series, where the src code is in C++ and 
the compiler used is the GCC ARM (version 4.4.1) which compiles fine.

We are observing that the compiler is behaving weird while dividing 
variables.

i.e.
var1 = var2/2  => OK
var1 = var2/3  => FAIL! (runtime issue, compiles fine)

var1 = var2/8  => OK
var1 = var2/6  => FAIL! (runtime issue, compiles fine)

Seems it behaves weird for some specific values of the divider.
We have verified the issue thru thorough testing so theres no doubt left 
about the observation.
Now we are trying to find a soln/workaround for the same.

Any such experiences with the GCC ARM compiler would be helpful.
Guest #3414002
Rate this post
• ▲ useful
▼ not useful
Sujit P. wrote:
> Can anyone suggest a solution for the same?
Define an empty dummy function:
1
void _isatty () {}
, compile & link. Then disassemble the code and see where it used, and 
remove that code.

Sujit P. wrote:
> var1 = var2/8  => OK
This will be optimized to a bitshoft (var2 >> 3)
> var1 = var2/6  => FAIL! (runtime issue, compiles fine)
Did you specify the correct ARM Core (Cortex-M0)? That core does not 
have a hardware division unit, you have to ensure the compiler generates 
software division code.
Guest #3417509
Rate this post
• ▲ useful
▼ not useful
You don't need a "CPP template", you need a "project template". Correct 
compiler options and linker file etc.

Since you not even replied to the question which core you're using, it's 
obviously not very urgent, and you'll be fine after taking your time 
reading the documentation.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.