View Single Post
  #4   Spotlight this post!  
Unread 17-02-2008, 23:30
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: printf's not displaying in Terminal Window?

Yeah, I spent an hour chasing down that one, too. A macro like this has three states:
Code:
#ifdef ENABLE_SERIAL_PORT_ONE_TX
The states are "true," "false," and "the programmer forgot to define it". By using the #ifdef approach, the last two states are equivalent, so the compiler can't help you.

That's why I prefer using
Code:
#if ENABLE_SERIAL_PORT_ONE_TX
where the macro value is '1' for enabled and '0' for disabled. If the programmer doesn't #define it to one of those values, the compiler will complain, and an hour is saved!
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.