AndrewAustern

Create a 'C' program in Dev Studio 2005 - Not a C++ program, and watch the display look like this:

// CTest.c

#ifdef __cplusplus

# error This message should be greyed out.

#else

# error This message should be colored.

#endif




Re: Visual C++ General C Code Display Incorrect

Simple Samples

Is this a question or a comment If this is a question then please specify the question. If this is a comment then please explain what you are saying.




Re: Visual C++ General C Code Display Incorrect

AndrewAustern

It's a bug report. Please take a look and fix it. Thanks.






Re: Visual C++ General C Code Display Incorrect

crescens2k

Actually, this is all part of the fun of the C++ part of the IDE.

Let me ask you one question.

You have a header file included in both a C and C++ file with the above preprocessor definition, which one does it grey out The answer is, both are correct.

So before you just say that it is wrong you should take several things into account. Is it included ONLY in C files Because of some interesting quirks, did you include it into the C source before or after you wrote it Finally, have you tried closing down the IDE, deleting the ncb file and restarting






Re: Visual C++ General C Code Display Incorrect

AndrewAustern

You wrote >>:

My response <<

>> Let me ask you one question.

<< Okay, but by my count, I see 4 questions.

>> You have a header file included in both a C and C++ file with the above preprocessor definition, which one does it grey out The answer is, both are correct.

<< No. I have no header. Re-read my post. I have a .c file, and NO header. This is a straw man argument. Please refrain from fallacious arguments.

http://www.nizkor.org/features/fallacies/straw-man.html

>> Is it included ONLY in C files

<< Yes, but it is NOT #included. Just simply type it into a .c file.

>> Because of some interesting quirks, did you include it into the C source before or after you wrote it

<< I didn't "#include" anything. Maybe this question is asking something else I don't understand

>> Finally, have you tried closing down the IDE, deleting the ncb file and restarting

<< Yes. Makes no difference.






Re: Visual C++ General C Code Display Incorrect

Simple Samples

Have you tried it in a C++ program I tried both and I get the same results whether the file is C or C++.






Re: Visual C++ General C Code Display Incorrect

Simple Samples

crescens2k wrote:
You have a header file

No, look again. It is just one file; a C file.

crescens2k wrote:
included in both a C and C++ file with the above preprocessor definition

No, there is not a header.

crescens2k wrote:
which one does it grey out The answer is, both are correct.

No, that is not possible.

crescens2k wrote:

So before you just say that it is wrong you should take several things into account. Is it included ONLY in C files Because of some interesting quirks, did you include it into the C source before or after you wrote it Finally, have you tried closing down the IDE, deleting the ncb file and restarting

I think you should try it. I think if you understand the question then you can't make the editor do the right thing, whether it is a C or a C++ source file. It is not a compiler problem; just the editor, and so it is just a matter of (in)convenience but it is irritating that Microsoft overlooked this.






Re: Visual C++ General C Code Display Incorrect

Simple Samples

AndrewAustern wrote:

<< No. I have no header. Re-read my post. I have a .c file, and NO header. This is a straw man argument. Please refrain from fallacious arguments.

http://www.nizkor.org/features/fallacies/straw-man.html

You need to give the person the benefit of doubt; doubt that they made a mistake intentionally. Your corrections are appropriate but it is innapropriate to get personal in this manner. Stick to the facts and let them do the communication, at least initially. In my experience, if a person is intentionally being ignorant, they will be quick to get personal.

I don't know what caused this misunderstanding, but I doubt that crescens2k intended to be incorrect.






Re: Visual C++ General C Code Display Incorrect

AndrewAustern

The example is simplified, but when the IDE showed me a grayed out line, it pushed me down a line of debugging that caused me hours of wasted time. So, it's not just inconvenience, but an actual business cost.

If the bug is present in the C++ build, Microsoft should fix it there too.

I completely understand the issue you present, but it has nothing to do with the bug report I made. If you don't work for Microsoft, I don't want to waste my time further by having this convesation with you. You can do nothing to fix it, so please get off the thread.






Re: Visual C++ General C Code Display Incorrect

Simple Samples

AndrewAustern wrote:
I completely understand the issue you present, but it has nothing to do with the bug report I made. If you don't work for Microsoft, I don't want to waste my time further by having this convesation with you. You can do nothing to fix it, so please get off the thread.

You did not make a bug report. If you want to do that then you need to be thorough and that is what I was trying to help you do.

Microsoft wants volunteers to help when possible. If you don't want volunteers helping you then you need to get off these forums.






Re: Visual C++ General C Code Display Incorrect

nobugz

The proper place to file bug reports is Product Feedback.





Re: Visual C++ General C Code Display Incorrect

Simple Samples

AndrewAustern wrote:

The example is simplified, but when the IDE showed me a grayed out line, it pushed me down a line of debugging that caused me hours of wasted time. So, it's not just inconvenience, but an actual business cost.

Can you be more specific about "pushed me down a line of debugging" I tried the following and had no problem putting a breakpoint on the line that executes, eventhough the line is greyed. I debugged it and the debugger broke at the breakpoint. So what is it that did not work for you

Code Snippet

#include <stdio.h>

void AndrewAustern() {

#ifdef __cplusplus

puts("__cplusplus");

#else

puts("Not __cplusplus");

#endif

}






Re: Visual C++ General C Code Display Incorrect

einaros

AndrewAustern wrote:

I completely understand the issue you present, but it has nothing to do with the bug report I made. If you don't work for Microsoft, I don't want to waste my time further by having this convesation with you. You can do nothing to fix it, so please get off the thread.



See the comment made by nobugz, and direct your attention there from now on. If you do not want input from non-Microsoft personel, this forum is not from you. That's a waste of our time as well.

Thread closed.