- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
void main( void )
{
//******************************
}
...
...
...
I would like to note that this is not a nested comment. This is a single-line'//' comment followed by a set of characters '*'.
My environment:
OS: Windows XP 32-bit
IDE: Visual Studio 2005 SP1
C++ compiler: Intel C++Composer XE 2011 Update 9
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm able to reproduce your finding now and agree that this remark should not show up here. Hence I've created a ticket for engineering (DPD200285580).
Thank you & best regards,
Georg Zitzlsberger
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't happen with any Microsoft C/C++ compilers or another C++ compilersused on the project.
Here ismore information for the case ( '//**********************' ):
- Intel C++ compiler - Reported as a nested comment
- Microsoft C++ compiler ( VS98 / VS2005 / VS2008 / VS2010 ) - Not reported
- MinGW C++ compiler - Not Reported
- Borland C++ compiler - Not reported
- Turbo C++ compiler - Not reported
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried to reproduce this problem and I'm not seeing this remark - even with warning level of 5.
Could you provide me a small Microsoft* Visual Studio 2005 solution?
Thank you & best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
However, there is a parsing bug if you do this:
[cpp]/* int main(int argc, char *argv[]) { //*************************/ return 0; } */ [/cpp] Compilation fails with:
test.cpp
test.cpp(5): error: expected a declaration
return 0;
^
test.cpp(6): error: expected a declaration
}
^
compilation aborted for test.cpp (code 2)
I am not sure what the standard says about it but I personally think that it should not happen because everything on a line after // should be treated as a line comment, and compiler mistakenly interprets */ at the end of the line as a closing tag for the current block comment.
Unfortunately both Visual Studio 2010 and GCC 4.5.3. have the same bug so I doubt anyone would want to fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...
#define _REMARK9
#undef _REMARK9
void main( void )
{
#if _REMARK9
//***************
#endif
}
...
Best regards,
Sergey
UPDATED: Please use a Test-Case from a Post #6.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is updated Test-Case that reproduces a 'remark #9' messageat aWarning Level 4:
[cpp] #define _REMARK9 #undef _REMARK9 #if _REMARK9 // Sub-Test for "remark #9" message { /* //******************************* */ } #endif [/cpp]
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm able to reproduce your finding now and agree that this remark should not show up here. Hence I've created a ticket for engineering (DPD200285580).
Thank you & best regards,
Georg Zitzlsberger

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page