HN user

BudVVeezer

1,059 karma
Posts54
Comments132
View on HN
blogs.grammatech.com 7y ago

Using Sarif with Clang and CodeSonar

BudVVeezer
1pts0
www.nature.com 8y ago

Structure and Distribution of an Unrecognized Interstitium in Human Tissues

BudVVeezer
1pts0
herbsutter.com 8y ago

Fall ISO C++ standards meeting (Albuquerque)

BudVVeezer
1pts0
www.sei.cmu.edu 9y ago

Software Engineering Institute Makes CERT C++ Coding Standard Freely Available

BudVVeezer
179pts24
www.justice.gov 9y ago

DoJ, DoA, and DoI to Rethink Dakota Access Pipeline

BudVVeezer
2pts0
www.dol.gov 9y ago

History of Labor Day

BudVVeezer
2pts0
www.thestar.com 9y ago

A huge crack is spreading across one of Antarctica’s biggest ice shelves

BudVVeezer
211pts104
www.youtube.com 10y ago

9.99999 reasons why .9999 (repeating) = 1

BudVVeezer
4pts0
mappingpoliceviolence.org 10y ago

Mapping Police Violence

BudVVeezer
1pts0
blogs.msdn.com 10y ago

Clang with Microsoft CodeGen in VS 2015 Update 1

BudVVeezer
118pts37
channel9.msdn.com 10y ago

VC++ turns 20 (2013)

BudVVeezer
1pts0
bahfest.com 10y ago

Festival of Bad Ad Hoc Hypotheses

BudVVeezer
2pts0
stackoverflow.com 10y ago

RegEx match open tags except XHTML self-contained tags

BudVVeezer
1pts0
en.wikipedia.org 10y ago

Ship of Theseus

BudVVeezer
46pts50
www.usenix.org 10y ago

Type Casting Verification: Stopping an Emerging Attack Vector [pdf]

BudVVeezer
8pts0
www.phrases.org.uk 11y ago

At one fell swoop

BudVVeezer
14pts6
www.us-cert.gov 11y ago

Top 30 Targeted High Risk Vulnerabilities

BudVVeezer
1pts0
blogs.msdn.com 11y ago

Control Flow Guard security feature

BudVVeezer
2pts0
discovermagazine.com 11y ago

The First Known Case of Virus-Attacks-Virus (2009)

BudVVeezer
2pts0
www.youtube.com 11y ago

How to convert an old washing machine into a water powered generator

BudVVeezer
1pts0
www.youtube.com 12y ago

Pyro Board: 2D Ruben's Tube

BudVVeezer
4pts0
bibliocurio.wordpress.com 12y ago

The Trouble with Mrs Hughes

BudVVeezer
2pts0
blog.aaronballman.com 12y ago

Implementing a four-bit adder with C++ template metaprogramming

BudVVeezer
1pts0
channel9.msdn.com 12y ago

Microsoft's GoingNative2013 conference live stream

BudVVeezer
1pts1
www.onemenny.com 13y ago

Pictures from a Developer's Life

BudVVeezer
1pts0
vimeo.com 13y ago

Ode to a Flower

BudVVeezer
1pts0
support.microsoft.com 14y ago

Epic MS KB Article

BudVVeezer
2pts0
blogs.msdn.com 14y ago

MSDN Blogs Have an Interesting View of Time

BudVVeezer
3pts1
www2.research.att.com 14y ago

The Origins of C++

BudVVeezer
1pts0
jimblog.me 14y ago

The C++ map

BudVVeezer
1pts0

It's consistent with for (init; condition;) {} and solves a problem like:

if (std::vector<int> v = f(); !v.empty()) { // Use v }

without requiring an extra compound statement to limit the scope and lifetime of v.

Not quite.

It was submitted for PDTS (proposed draft technical standard), which means it goes out for balloting to ISO national bodies. That balloting either succeeds (at which point you have a Techincal Specification) or it comes back to the committee with comments that the committee then has to respond to (and then another round of balloting happens). Once it's accepted as a Technical Specification, it's still not part of the C++ International Standard. That's a decision the committee comes to at their own pace, much like what happened at this meeting where the Concepts TS was accepted (as amended) into the IS.

Think of a TS somewhat like a beta. There's no assurance that the contents of the TS will go into the IS at all or in the exact form it was originally specified in, but that's certainly the hope when the TS is published.

What's considered critical or difficult to discover is a bit subjective, but:

It's easy to forget that alignment is important on some architectures (other than for performance reasons), so be careful when using placement new: https://www.securecoding.cert.org/confluence/display/cpluspl...

This may seem obvious, but even the C++ committee got this one wrong when they created auto_ptr (which has since been removed from the standard): https://www.securecoding.cert.org/confluence/display/cpluspl...

This one is totally obvious but has a stunning number of ways you can fail to adhere to it, some of which look reasonable at first blush: https://www.securecoding.cert.org/confluence/display/cpluspl...

Yes and no. Many compilers support #pragma once, but whether your build environment handles it is another matter. Having your headers on network drives, or having symlinks to your headers, etc can cause issues with #pragma once handling (depending on the implementation) that can often be hard to track down, especially if building with multiple compilers. Include header guards do not have these issues.

The author may be a bit confused as to what C++17 will be. Modules will be in a TS, most likely. Transactional memory, concepts, ranges, and filesystem are already in published TSes (not planned for the IS in this round). Out of the list presented, only fold expressions and __has_include are actually already voted in for C++17 itself. The rest are in various stages of standardization (mostly TSes) and are not guaranteed to ever become part of the IS (though hopefully many will).

Boost is a very large project with varying degrees of API quality, and so when you say it depends on boost, I wonder "the good parts (any, variant, stuff that usually gets looked at for standardization)" or "the bad parts (Spirit, etc)". Also, as others have said, it's a huge dependency that generally raise a red flag (for performance and compile time).

I think this is a good step in the right direction, but still falls short. For instance, it's heavily gender binary, and has odd cultural mismatches such as "man with turban" but no "woman with hijab." However, major kudos to the Unicode consortium for their work on this -- it's a very challenging set of subjects to get into!

This topic was discussed in Lenexa at last week's C++ standards meeting, and the direction the core working group was thinking was that this should be ill-formed, but is currently under specified. I would not rely on this ADL constexpr trick working for long (at least until CWG has had the chance to really pick apart the issue and change the wording to explicitly allow it).

C99 tricks 11 years ago

One of the two values (a or b) gets evaluated twice. Eg)

  min(a++, b++);
a or b would really be incremented twice.

It can, and it is. One of the outcomes of the CERT C secure coding standard was the publication of TS 17961, which is an ISO document on C analyzability, which also went hand in hand with the Annex L (normative) section of the C standard.

Basically, the CERT rules all must be analyzable (though some require dynamic analysis instead of static analysis).

I just tried the following simple example:

  #include <string.h>

  struct S {
    int i;
    char c;
    int j;
  };

  void f(void) {
    struct S s1 = { 0, 0, 0 }, s2 = { 0, 0, 0 };
    memcpy(&s1, &s2, 9);
  }

  int main(void) {
    f();
    return 0;
  }
MSVC, Clang, and PC-Lint are all silent on the code (which is reasonable behavior since it's impossible to glean programmer intent from that snippet -- maybe the programmer really only wants the first nine bytes!). (Btw, yes, I am using the analyzer features for MSVC and Clang, not just relying on high warning levels.)

It's shocking to see how often people write code like: memcpy(somePtr, &myStructObj, 12);

So while that warning can certainly be useless information, it does definitely catch bugs. Unfortunately, the people who write code like the above are also more likely to be people who ignore warnings. ;-)

Except that it was a collaborative effort that involved far more than just Microsoft, such as CERT, and the WG14 committee as a whole...

Heartbleed 12 years ago

We tested most of the major ones at work on the faulty code, and only PC-Lint caught the issue.