r/cpp • • 17d ago

Google talk at REBASE'26: Agentic Coding is not going to save C++

So the REBASE'26 conference happened recently, and besides the whole thing of what Carbon has achieved or never will, there are talks like this one from Google folks, regarding what they are doing with their C++.

The talk is all about the recent ongoing migration discussed on Google security blog, and other related efforts.

https://www.youtube.com/watch?v=Ob0CMX8s55s

77 Upvotes

212 comments sorted by

View all comments

Show parent comment

3

u/CreativeAlbatross319 13d ago

Raw pointer deference is a hard decision. In many cases you don't want it checked to get the max performance.

Tagged union pretty much not allowed as clang-tidy forbids any usage of C enum and access of any union type.

Int overflow is the same story as raw pointer deference, as it potentially damages the performance or compiler optimization.

0

u/chaos_pill 13d ago

yeah, nobody's criticizing them for making sane decisions. Just pointing out that unsafe C heritage is hard to remove in theory, but almost impossible in practice (the vast majority of code is still legacy c/c++, and they are not going to adopt profiles or even clang-tidy anytime soon).

3

u/CreativeAlbatross319 13d ago

But I would argue that static analyzers pretty much already remove 95% unsafe usages both from C and old C++, especially banning new/delete, C arrays, C chars*, index access via brackets, pointer arithmetic, etc. The rest of 5% being still there wouldn't be a huge deal.

1

u/chaos_pill 12d ago

The 5% unsafe, at best, is just raw C. But, there's also unsafe C++ parts like iterator invalidation, ODR violations (eg: contracts if approved), unchecked optional deref or vector indexing, const_cast etc..

I agree that static analyzer helps A LOT, but most can't use it because they will need to rewrite significant portions of their c/c++ codebase.