> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Jason Hsu > Sent: 01 March 2010 16:02 > To: Microcontroller discussion list - Public. > Subject: Re: [PIC]Function declaration causes error in one program but not > another > > Thanks, Alex. As you suspected, the problem turned out to be in the > comment lines immediately preceding the delay_1_msec function > declaration. The errors disappeared once I removed those comment > lines. > > Now I understand why it's so important to archive the source code as > you accomplish various things while working on a program. Even > comment lines can be misinterpreted by a compiler. > > How can comment lines be misinterpreted by a compiler? Comment lines > are SUPPOSED to be ignored by the compiler. What went wrong here? > > More importantly, how do you tell if a compiler is misinterpreting > your source code? My code looked fine in MPLAB, Geany, and Leafpad. > I don't know how I'm supposed to tell if I'm relying on editing tools > that don't show me what the compiler sees. I've had odd control characters in source code causing compilation issues in the past. I'm not sure how they got there but some kind of copy/paste bug is the most likely. This kind of thing is certainly 'interesting' to track down if it's the first time you've experienced it. Most text editors will not show non-printing characters by default; the source would look a mess otherwise. However, decent editors will either have an option to display line breaks (carriage returns/linefeeds) or you can view the file in a hex editor and check the suspect lines for any odd characters. MPLAB has never had what I would call a decent editor... Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist