[PATCH] D107575: [Flang] Ported test_errors.sh to Python

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 13:29:41 PDT 2021


Meinersbur added a comment.

In D107575#2929251 <https://reviews.llvm.org/D107575#2929251>, @Leporacanthicus wrote:

> Me and Ivan spent some time figuring this out today. Why do compilers/libraries have to do these sort of things their own way? ;)

Usually the underscore exists because these function were introduced by POSIX. Since Windows is not POSIX, those were originally not defined. Microsoft implemented most of them later anyway, but since code may have used their names already (e.g. to implement them because they were missing), they added the underscore to not clash with existing code. See e.g. https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=msvc-160#posix-function-names

`vsnprintf` was standardized only "recently" in C++11 <https://en.cppreference.com/w/c/io/vfprintf> and C99 <https://en.cppreference.com/w/c/io/vfprintf>(*). That is, it should work on version of msvc that support C++11 (it does for me), but the dollar-sign again is a POSIX extension <https://stackoverflow.com/a/19327442>. I suggest not to rely on it.

(*) Microsoft only started implementing strategic C99 features in VS2017, generally considers it C++-only compiler.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107575/new/

https://reviews.llvm.org/D107575



More information about the llvm-commits mailing list