Article ID: 199057 - View products that this article applies to.
This article was previously published under Q199057
This article has been archived. It is offered "as is" and will no longer be updated.
The results of the __LINE__ macro are incorrect when you use Debug Information for Edit and Continue (/ZI). The problem may manifest itself as compiler, linker, or run-time errors.
To work around this problem, use the Program Database option (/Zi) instead of Edit and Continue (/ZI).
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
The following sample code demonstrates the problem.
When compiled with the /Zi option, output is correct:
Message at line 12When compiled with the /ZI option, output is incorrect:
Message at line (__LINE__Var+1)
Article ID: 199057 - Last Review: February 23, 2014 - Revision: 4.1
Contact us for more help
Connect with Answer Desk for expert help.