search for: float_var

Displaying 4 results from an estimated 4 matches for "float_var".

Did you mean: float_varg
2016 Oct 14
2
RFC: General purpose type-safe formatting library
...wrote: >> If you change a const char * to a StringRef, it can silently succeed >> while passing your StringRef object to printf. It should fail to compile! > > llvm::format now fails to compile as well :) > > However this does not address other issues, like: `format(“%d”, float_var)` This may be a good time to point at https://reviews.llvm.org/D25018 But if someone ends up doing a full overhaul of the formatting that makes that patch unnecessary, I'm happy too. Cheers, Nicolai
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...> > If you change a const char * to a StringRef, it can silently succeed > while passing your StringRef object to printf. It should fail to compile! > > > llvm::format now fails to compile as well :) > > However this does not address other issues, like: `format(“%d”, > float_var)` > > > 2. *Not security safe. *Functions like sprintf() will happily smash your > stack for you if you're not careful. > > 3. *Not portable (well kinda). *Quick, how do you print a size_t? You > probably said %z. Well MSVC didn't even support %z until 2015, which w...
2016 Oct 31
0
RFC: General purpose type-safe formatting library
...onst char * to a StringRef, it can silently succeed > >> while passing your StringRef object to printf. It should fail to > compile! > > > > llvm::format now fails to compile as well :) > > > > However this does not address other issues, like: `format(“%d”, > float_var)` > > This may be a good time to point at https://reviews.llvm.org/D25018 > > But if someone ends up doing a full overhaul of the formatting that > makes that patch unnecessary, I'm happy too. > > Cheers, > Nicolai > -------------- next part -------------- An HTML att...
2016 Oct 12
15
RFC: General purpose type-safe formatting library
A while back llvm::format() was introduced that made it possible to combine printf-style formatting with llvm streams. However, this still comes with all the risks and pitfalls of printf. Everyone is no-doubt familiar with these problems, but here are just a few anyway: 1. *Not type-safe.* Not all compilers warn when you mess up the format specifier. And when you're writing your own