cannot print hex values LIBDEF_PRINTF_ALLOW_HEXINT

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

cannot print hex values LIBDEF_PRINTF_ALLOW_HEXINT

Jump to solution
1,062 Views
rlstraney
Contributor III

Hello,

I cannot print hex values using %x.  

 

I am using Codewarrior 7.1 build 14 

 

I found a thread about this posted by CrasyCat.  Where CrasyCat says "Open the project" and "Activate target"  can someone please explain how to do this?

 

Do I close my project and open the mcp that is being referenced?   I tried opening a few of the mcps in that directory and hitting alt-F7 but none of them give me the  "C/C++ Preprocessor" panel

 

I am assuming the mcp file is a new name now.   But I have no idea what Activate target "2i ColdFire RegABI" means to do.   The rest of the instructions I understand.

 

Here are the instructions that were posted by CrasyCat:

 

You can activate support for display of Hexadecimal number in the following way:
  - Start the IDE
  - Open the project {Install}\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Project\MSL_C.CF.v1.word.mcp (where {Install} refers to your CodeWarrior installation directory)
  - Activate target "2i ColdFire RegABI"
  - Open the target settings dialog (press ALT+F7)
  - Switch to the "C/C++ Preprocessor" panel
  - Add following line in there:
        #define LIBDEF_PRINTF_ALLOW_HEXINT 1
  - Close the Target Settings dialog pressing OK
  - Press the Make button to rebuild the library
  - rebuild your project.
 
printf should support %X from now on.
 

I was hoping that I just needed to open my project and go to the"C/C++ Preprocessor" panel and

add following line in there:

        #define LIBDEF_PRINTF_ALLOW_HEXINT 1

But that didn't work...

 

Please help!

Renee

Labels (1)
0 Kudos
1 Solution
315 Views
rlstraney
Contributor III

This is what I did to get %x to work in printf - although I don't think this is the way it was intended to be done:

 

 

I added printf_tiny_IO.c to my project

In my project I hit alt-f7 and added the following:

#define LIBDEF_PRINTF_ALLOW_HEXINT 1

 

Then %x worked in printf.

 

Renee

 

 

View solution in original post

0 Kudos
1 Reply
316 Views
rlstraney
Contributor III

This is what I did to get %x to work in printf - although I don't think this is the way it was intended to be done:

 

 

I added printf_tiny_IO.c to my project

In my project I hit alt-f7 and added the following:

#define LIBDEF_PRINTF_ALLOW_HEXINT 1

 

Then %x worked in printf.

 

Renee

 

 

0 Kudos