<p>Do any editors honer C #line directives with regards to goto line features?</p>

<p><em>Context:</em>
I'm working on a code generator and need to jump to a line of the output but the line is specified relative to the the #line directives I'm adding.
I can drop them but then finding the input line is even a worse pain</p>

[{'answer_id': 50852, 'author': 'Jason Cohen', 'author_id': 4926, 'author_profile': 'https://Stackoverflow.com/users/4926', 'pm_score': 0, 'selected': False, 'text': "<p><code>#line</code> directives are normally inserted by the precompiler, not into source code, so editors won't usually honor that if the file extension is <code>.c</code>.</p>\n\n<p>However, the normal file extension for post-compiled files is <code>.i</code> or <code>.gch</code>, so you might try using that and see what happens.</p>\n"}, {'answer_id': 50916, 'author': 'Thomas Kammeyer', 'author_id': 4410, 'author_profile': 'https://Stackoverflow.com/users/4410', 'pm_score': 0, 'selected': False, 'text': '<p>I\'ve used the following in a header file occasionally to produce clickable items in\nthe VC6 and recent VS(2003+) compiler ouptut window.</p>\n\n<p>Basically, this exploits the fact that items output in the compiler output\nare essentially being parsed for "PATH(LINENUM): message".</p>\n\n<p>This presumes on the Microsoft compiler\'s treatment of "pragma remind".</p>\n\n<p>This isn\'t quite exactly what you asked... but it might be generally helpful\nin arriving at something you can get the compiler to emit that some editors might honor.</p>\n\n<pre>\n    // The following definitions will allow you to insert\n    // clickable items in the output stream of the Microsoft compiler.\n    // The error and warning variants will be reported by the\n    // IDE as actual warnings and errors... which means you can make\n    // them occur in the task list.\n\n    // In theory, the coding standards could be checked to some extent\n    // in this way and reminders that show up as warnings or even\n    // errors inserted...\n\n\n    #define strify0(X) #X\n    #define strify(X) strify0(X)\n    #define remind(S) message(__FILE__ "(" strify( __LINE__ ) ") : " S)\n\n    // example usage\n    #pragma remind("warning:  fake warning")\n    #pragma remind("error:  fake error")\n</pre>\n\n<p>I haven\'t tried it in a while but it should still work.</p>\n'}, {'answer_id': 90165, 'author': 'jussij', 'author_id': 14738, 'author_profile': 'https://Stackoverflow.com/users/14738', 'pm_score': 3, 'selected': True, 'text': '<p>If the editor is scriptable it should be possible to write a script to do the navigation. There might even be a Vim or Emacs script that already does something similar.</p>\n\n<p>FWIW when I writing a lot of Bison/Flexx I wrote a <a href="http://www.zeusedit.com" rel="nofollow noreferrer">Zeus</a> Lua macro script that attempted to do something similar (i.e. move from input file to the corresponding line of the output file by search for the #line marker).</p>\n\n<p>For any one that might be interested <a href="http://www.zeusedit.com/forum/viewtopic.php?p=4065" rel="nofollow noreferrer">here is</a> that particular macro script.</p>\n'}, {'answer_id': 96374, 'author': 'user10392', 'author_id': 10392, 'author_profile': 'https://Stackoverflow.com/users/10392', 'pm_score': 0, 'selected': False, 'text': '<p>Use sed or a similar tool to translate the #lines to something else not interpreted by the compiler, so you get C error messages on the real line, but have a reference to the original input file nearby.</p>\n'}]
['https://Stackoverflow.com/questions/50819', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1343/']