Skip to content

Conversation

@laurensmiers
Copy link

MCPP fails to compile due to stricter checks in newer compiles.

First error is regarding a mismatch of argument expectations:

mcpp_main.c: In function ‘mcpp_lib_main’:
mcpp_main.c:305:5: error: too many arguments to function ‘mb_init’; expected 0, have 1
  305 |     mb_init(TRUE);      /* Should be initialized prior to get options   */
      |     ^~~~~~~
In file included from mcpp_main.c:39:
internal.H:419:17: note: declared here
  419 | extern void     mb_init();
      |                 ^~~~~~~
make: *** [<builtin>: mcpp_main.o] Error 1

Second error is regarding the use of reserved keywords for goto-labels:

system.c: In function ‘open_file’:
system.c:1741:15: error: expected identifier or ‘*’ before ‘true’
 1741 |         goto  true;
      |               ^~~~
system.c:1768:19: error: expected identifier or ‘*’ before ‘false’
 1768 |             goto  false;
      |                   ^~~~~
system.c:1773:15: error: expected identifier or ‘*’ before ‘false’
 1773 |         goto  false;
      |               ^~~~~
system.c:1805:5: error: expected ‘;’ before ‘:’ token
 1805 | true:
      |     ^
      |     ;
system.c:1807:6: error: expected ‘;’ before ‘:’ token
 1807 | false:
      |      ^
      |      ;
make: *** [<builtin>: system.o] Error 1

When both of these are tackled, mcpp compilation succeeds using GCC 15.22.1:

$ cc --version
cc (GCC) 15.2.1 20250813
$ make
$ ls lib64/libmcpp.a
lib64/libmcpp.a

This was also flagged in the original mcpp, but no fix accepted yet:
https://sourceforge.net/p/mcpp/bugs/18/

This fix is necessary if we want to install zeroc-ice pypi package since on Linux, the backend is build and these errors pop-up.

Defined in mbchar.c:114 :
```c
void    mb_init()
/*
 * Initialize multi-byte character settings.
 * First called prior to setting the 'mcpp_mode'.
 * Will be called again each time the multibyte character encoding is changed.
 */
{
```

It does not expect any parameters.
Rename:
- 'true' to 'exit_success'
- 'false' to 'exit_fail'

Chose not to change the flow of the code by removing the goto's to
avoid regressions.
@CLAassistant
Copy link

CLAassistant commented Oct 22, 2025

CLA assistant check
All committers have signed the CLA.

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