please tell me how to keep option -D __NO_FLOAT__ in code warrior compiler for MC9S12XDP512

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

please tell me how to keep option -D __NO_FLOAT__ in code warrior compiler for MC9S12XDP512

1,752 Views
sunil99
Contributor I
hai sir,
           please tell me how to keep option -D __NO_FLOAT__ in code warrior compiler for MC9S12XDP512 i am not able to find it out in compiler settings and another problem is that when i wanted to tick the option preprocessor definitions( for the source code written by me) in compiler settings its throwing error illegal option how to over come it please elaborate on it and exactly what the mentioned option will do i am asked to enable that option but i am not finding it please reply me.can you send me any files or suggest any showing in detail explanation about compiler settings and linker settings for MC9S12XDP512 for codewarrior.
 
 
thanking you in advance
bye
sunil99
Labels (1)
Tags (1)
0 Kudos
2 Replies

673 Views
J2MEJediMaster
Specialist I
That's a good question. I know you can get this option when you use the CodeWarrior project wizard to build the initial project and specify that you don't want floating-point. Then -D __NO_FLOAT__ shows up in the IDE's Compiler for HC12 settings panel. However, after fooling around, I didn't see any way of using the options controls in the panel to get it back if you wipe it out accidentally. I'll have to check with the IDE guys about that. However, you can type the string into the Comand line arguments field to restore it. I'm using CW 4.5.

In your CodeWarrior directory, there's a Help directory, with a sub-directory PDF. In this PDF directory you'll find Acrobat PDF files for the CodeWarrior tools. The file Compiler_HC12.pdf, which is the HC(S)12 Compiler Manual, has detailed explanation as to the various compiler options and directives. Check the chapter on "Using the Compiler."

---Tom

673 Views
CompilerGuru
NXP Employee
NXP Employee
There is no space in between the -D and the __NO_FLOAT__, so the option is
"-D__NO_FLOAT__"  and not "-D __NO_FLOAT__ "

The -D option is in the GUI in the language panel and is called Preprocessor definitions.
Just enable it and write __NO_FLOAT__ into the field and the compiler will add -D__NO_FLOAT__ for you.

Note that the main effect of -D__NO_FLOAT__ is when compiling the library, more specifically printf.c.
There is already a pre built library with -D__NO_FLOAT__ , see lib\hc12c\readme.txt, so unless you compile printf.c on your own, the effect of -D__NO_FLOAT__ is not that significant. If you do not compile printf.c and you do use (s)printf, be sure to link against the right library.

Daniel