Skip to content

Conversation

@tueda
Copy link
Collaborator

@tueda tueda commented Jan 10, 2026

C23 (N3054 (PDF)) has removed K&R1-style function declarations from its syntax (N2432 (PDF)). Maybe it's time to assume C89-compatible compilers are always available.

For example, MesPrint is defined in message.c as follows:

int
#ifdef ANSI
MesPrint(const char *fmt, ... )
#else
MesPrint(va_alist)
va_dcl
#endif
{
...

As a result, VSCode can't jump to MesPrint using "Go to Definition".

We also assumes <stdarg.h> is always available.

We still use ANSI to select the date and timer implementations, though probably no one tries to compile FORM for freestanding environments where <time.h> and similar headers are not available (except for WebAssembly?). This code may need to be refactored in the future.

Note that there are many other places where K&R1 coding style is used (e.g., return(0);), but that's a separate issue (see also #712).

@coveralls
Copy link

Coverage Status

coverage: 53.349% (+0.009%) from 53.34%
when pulling 2c3df78 on tueda:pr/refactor/remove-pre-c89-legacy-code
into 73a6a14 on form-dev:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants