Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. ohmygosh2

    #line directive

    Salem, this is the solution I currently use before the C preprocessor. It has the weakness that if there is a #if/#endif enclosing the lines you added, then the scheme fails. If I were to work using your suggestion: after the C preprocessor, then the #line directive won't work I think. I looked...
  2. ohmygosh2

    #line directive

    Yes cpjust, this is the solution I gave. After every #else or #endif you recalculate the line number and issue a #line. But that makes you program more complex. Which is unfortunate. The C standard should have specified that #line is not subject to #if conditions.
  3. ohmygosh2

    #line directive

    Yes, one option is to process the file after the C preprocessor. But this option has its own issues. For example, if I insert new lines in the file, how do I inform the compiler of the new line numbering? Is there a standard method or is it compiler dependent?
  4. ohmygosh2

    #line directive

    Replacing #if 0 with #if 1: of course then it works. My point is that line numbering should be independent of other compiler directives. Line numbering should not change if I use #if 0 or #if 1. The line number in the file does not change!!! We could distinguish between two things: - Regular...
  5. ohmygosh2

    #line directive

    This is to propose an improvement to the #line directive of the C preprocessor, or to ask for a workaround. Currently, it seems that the #line directive is "ignored" if it lies between a #if and a #endif directives ! I believe that in most practical cases, this behavior is undesired. Example...

Part and Inventory Search

Back
Top