qsort_s has arguments from MSVC, not from C11 standard or GCC
The C11 standard introduced a sorting function qsort_s
That is in Annex K, which makes it optional; MinGW does not provide it, isn't required to provided it, and isn't likely to do so.
Mingw seems to have taken the MSVC function declaration instead of the standard one
No, it hasn't; you will not find a declaration for qsort_s() in any genuine MinGW header. (You may find the symbol in a MinGW libmsvcrt.a import library, but there is no corresponding declaration in any MinGW header file). In any case, since MinGW uses the Microsoft MSVCRT runtime library, if the interface were to be exposed, it would relate to the MSVCRT.DLL implementation, so the MSVC semantics would be correct. Blame Microsoft for adopting their own standards; from a MinGW perspective, this is a definite "won't fix".
The C11 standard introduced a sorting function qsort_s, which accepts an extra argument as data that is passed to the sorting function. In GCC and standard C11, the comparison function that is passed to qsort_s has this new data argument as the last argument, while MSVC has it as the first argument. Mingw seems to have taken the MSVC function declaration instead of the standard one.