curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

RE: C99

From: Marcel Raad via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 20 Sep 2022 10:25:58 +0000

Hi,

> At the same time, if we accept C99 it will be hard to enforce restrictions
> with compilers and checksrc certainly will not stop most of the things in that
> list (the //-comments perhaps being the single exception).
>
> Thoughts?

I like the idea and agree that would be the perfect time to switch. Especially the mixed declarations and code will make contributions much easier for us C++ developers without getting headaches trying to avoid compiler warnings from conditionally used code.

Speaking of compiler restrictions though, as Christoph already mentioned, Visual Studio implemented (almost) full C99 support very late, which might be an issue:
- the intersection between C90 and C++98, like C++ comments and mixed code and declarations, has been supported since basically forever
- Visual Studio 2005 (which also dropped support for targeting Windows versions before 98 / NT 4.0) added variadic macros and long long
- Visual Studio 2010 (which only supports Windows XP and later) added stdint.h
- Visual Studio 2013 and later implemented more features
- full support (minus the features that were made optional in C11) was finally implemented in VS 2019 Update 8 (which only supports Windows Vista and later)

So we might have to use the subset of C99 supported by a particular "old enough" Visual Studio version, maybe 2013. And we could at the same time remove support for older Windows versions from the code, maybe making Windows 2000 the minimum, which classic MinGW still defaults to.

Marcel
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-09-20