Comments (4)
Aunk, the guidelines are meant to be adopted as a whole, but developers are free to opt out of any individual guidelines as they see fit. If you need to have a meta engine or variable buffer sizes in your code, you should opt out of the array subscript guidelines for those sections of your code.
C++ is a powerful programming language. We want to preserve your ability to write powerful code. However, the requirements of any particular program don't influence the guidance. For those programs, just opt out.
from cppcoreguidelines.
How do i opt out?
from cppcoreguidelines.
The guidelines are meant to be enforced by your compiler or static analysis tools. Opting out globally is equivalent to not apply that particular guideline to your code. Opting out for a specific section of your code should be possible by adding a #pragma(suppress, xxxx) or [suppress: xxxx] attribute that references the particular guideline enforcement to suppress.
Microsoft’s version of the enforcement tooling will support both these mechanisms to opt out.
From: Anthony David Pulse, Jr. [mailto:[email protected]]
Sent: Sunday, September 20, 2015 10:24 AM
To: isocpp/CppCoreGuidelines [email protected]
Cc: Andrew Pardoe [email protected]
Subject: Re: [CppCoreGuidelines] Req: array subscript rules be taken out. (#24)
How do i opt out?
—
Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fisocpp%2fCppCoreGuidelines%2fissues%2f24%23issuecomment-141812177&data=01%7c01%7cAndrew.Pardoe%40microsoft.com%7cf2ed3244d98b4f00f93308d2c1e04c69%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=qTQKf7h139hdruhySd5EChZxR%2bJDa7%2f2pR%2f3Y330dpM%3d.
from cppcoreguidelines.
Btw, would you look at github.com/aunk/press and tell me if it works? Not one coder will give me a straight eye for it. I just want to know if it works. And i don't have a pc to do it on. It's in C++. Thanks.
Sent from my ASUS Pad
Andrew Pardoe [email protected] wrote:
The guidelines are meant to be enforced by your compiler or static analysis tools. Opting out globally is equivalent to not apply that particular guideline to your code. Opting out for a specific section of your code should be possible by adding a #pragma(suppress, xxxx) or [suppress: xxxx] attribute that references the particular guideline enforcement to suppress.
Microsoft’s version of the enforcement tooling will support both these mechanisms to opt out.
From: Anthony David Pulse, Jr. [mailto:[email protected]]
Sent: Sunday, September 20, 2015 10:24 AM
To: isocpp/CppCoreGuidelines [email protected]
Cc: Andrew Pardoe [email protected]
Subject: Re: [CppCoreGuidelines] Req: array subscript rules be taken out. (#24)How do i opt out?
—
Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fisocpp%2fCppCoreGuidelines%2fissues%2f24%23issuecomment-141812177&data=01%7c01%7cAndrew.Pardoe%40microsoft.com%7cf2ed3244d98b4f00f93308d2c1e04c69%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=qTQKf7h139hdruhySd5EChZxR%2bJDa7%2f2pR%2f3Y330dpM%3d.—
Reply to this email directly or view it on GitHub.
from cppcoreguidelines.
Related Issues (20)
- SF.2 allow inline variables and static inline class member variables HOT 1
- F.16 (pass by reference to const / by value): Request for clarification HOT 6
- Poor (and nearly-incorrect) example for rule F.27 (shared_ptr) HOT 4
- Challenging C.153 "Prefer virtual function to casting" HOT 4
- ES.56 Clarification on moving when assigning to reference outside of scope HOT 3
- F.16 Allow pass-by-value for types that are copied HOT 2
- `gsl::suppress` issues collected: Strings, literals, cases HOT 2
- Hi
- New NL Rule suggestion: Place comment-only lines before the code they apply to HOT 1
- Should/can Expects and Ensures be macros?
- Check for invalidated iterator/dangling reference on heap reallocation HOT 2
- Turning off clang unsafe buffer warnings fails when compiling with a gcc based compiler HOT 2
- CodSoft Internship Task 2 /TASK 2 SIMOPLE CALCULATOR #include <iostream> using namespace std; int main() { double num1, num2; char operation; // Input cout << "Enter first number: "; cin >> num1; cout << "Enter second number: "; cin >> num2; cout << "Enter operation (+, -, *, /): "; cin >> operation; // Calculation and output switch (operation) { case '+': cout << "Result: " << num1 + num2; break; case '-': cout << "Result: " << num1 - num2; break; case '*': cout << "Result: " << num1 * num2; break; case '/': if (num2 != 0) cout << "Result: " << num1 / num2; else cout << "Error! Division by zero."; break; default: cout << "Invalid operation!"; } return 0; } HOT 2
- Cpp programs HOT 3
- C.30: Define a destructor if a class needs an explicit action at object destruction - note HOT 1
- Sss
- Practice HOT 1
- #include HOT 1
- How to refer to the guidelines, bibtex preferred? HOT 2
- I.2: Avoid non-const global variables, but exempt "file scope" from this rule HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppcoreguidelines.