CodeWarrior 4.5 for HCS12:long variables in printf

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

CodeWarrior 4.5 for HCS12:long variables in printf

Jump to solution
1,973 Views
eddie
Contributor I
Using CodeWarrior 4.5 for HCS12(MC9S12NE64).
Does printf support long 32 bit variables?Don't seem
to be able to make it work.Any help would be appreciated.
Eddie
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,076 Views
CompilerGuru
NXP Employee
NXP Employee
yes, it does support it, but make sure you have enough stack space defined.
Also consider that printf is both large in flash and in stack usage, using something more specifically tuned for your purpose may safe memory, but if space (RAM/FLASH) is not an issue, (s)printf does work for longs.

Daniel

View solution in original post

0 Kudos
Reply
1 Reply
1,077 Views
CompilerGuru
NXP Employee
NXP Employee
yes, it does support it, but make sure you have enough stack space defined.
Also consider that printf is both large in flash and in stack usage, using something more specifically tuned for your purpose may safe memory, but if space (RAM/FLASH) is not an issue, (s)printf does work for longs.

Daniel
0 Kudos
Reply