Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preprocessor defines #warning (and custom #warn) are not supported #3142

Closed
n3rd4i opened this issue Feb 7, 2019 · 3 comments
Closed

Preprocessor defines #warning (and custom #warn) are not supported #3142

n3rd4i opened this issue Feb 7, 2019 · 3 comments

Comments

@n3rd4i
Copy link

n3rd4i commented Feb 7, 2019

Type: LanguageService

https://github.com/Microsoft/vscode-cpptools

Describe the bug
The preprocessor directives #warning and #warn are not suppored in Language Service.

  • OS and Version:
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18329 N/A Build 18329
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
BIOS Version:              LENOVO 39CN16WW       , 7/29/2010
  • VS Code Version:
Version: 1.31.0 (user setup)
Commit: 7c66f58312b48ed8ca4e387ebd9ffe9605332caa
Date: 2019-02-05T22:35:56.624Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.18329
  • C/C++ Extension Version:
Name: C/C++
Id: ms-vscode.cpptools
Description: C/C++ IntelliSense, debugging, and code browsing.
Version: 0.21.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
  • Other extensions you installed (and if the issue persists after disabling them): N/A

To Reproduce

  1. Example:
#include <stdio.h>

#define A
#define B

#if defined(C)
// stuff here 1
#elif defined(D)
// stuff here 2
#  define some_define__ some/path/file.h

#else
#  warn can't some situation here
#endif

void main(){
	return 0;
}
  1. See error: The Language Service does not work in this case
    2.1: error Code completion with C/C++ extension #1: unrecognized preprocessing directive
    2.2: error Path must be a string. Received undefined #2: The code highlight is wrong. (not even GitHub understands this.)

Expected behavior

Screenshots

Additional context

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Feb 7, 2019

What is "#warn"? What compiler supports that? Where is that defined in the C/C++ language?

#warning is expected to work if we ever ship warning support -- it was implemented, but post-poned because we wanted to add the ability to suppress unwanted warnings first: #828

UPDATE: And our extension doesn't implement any syntax colorization yet, so "#warn" would need to be added the VS Code's implementation (i.e. atom/language-c).

@sean-mcmanus sean-mcmanus added Language Service Feature Request more info needed The issue report is not actionable in its current state labels Feb 7, 2019
@n3rd4i
Copy link
Author

n3rd4i commented Feb 7, 2019

Some embedded compilers support this #warn which is #warning preprocessor directive.
Example doc page. 45

Maybe it could be a good Idea to allow users to customize this so the Language Service understand such syntax.

@sean-mcmanus sean-mcmanus removed the more info needed The issue report is not actionable in its current state label Feb 7, 2019
@sean-mcmanus sean-mcmanus added this to the Triage milestone Feb 7, 2019
@n3rd4i
Copy link
Author

n3rd4i commented Nov 23, 2019

not sure if there is update on this, will close because its stalled

@n3rd4i n3rd4i closed this as completed Nov 23, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants