Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the library C89-compatible #173

Open
lygstate opened this issue Dec 15, 2023 · 12 comments
Open

Make the library C89-compatible #173

lygstate opened this issue Dec 15, 2023 · 12 comments
Labels

Comments

@lygstate
Copy link

For relative old but still usable OS such vxWorks 6.x, we want a cross-platform printf to handling printf things and use c89 syntax supported

@eyalroz
Copy link
Owner

eyalroz commented Dec 15, 2023

The library is currently written with C99 assumed. What would it take to make it compile as C89? Apart from the comment style change?

Also, do the C compiler on vxWorks 6.x really not support C99?

@lygstate
Copy link
Author

The library is currently written with C99 assumed. What would it take to make it compile as C89? Apart from the comment style change?

Also, do the C compiler on vxWorks 6.x really not support C99?

its default option didn't support for double line comment

@eyalroz
Copy link
Owner

eyalroz commented Dec 15, 2023

its default option didn't support for double line comment

And with a non-default option?

Also, there are many other changes which would be necessary to make the library C89-compliant. Specifically, we would need to not use long long and avoid mixing declarations and code. How come the vxWorks compiler accepts it then?

@lygstate
Copy link
Author

its default option didn't support for double line comment

And with a non-default option?

Also, there are many other changes which would be necessary to make the library C89-compliant. Specifically, we would need to not use long long and avoid mixing declarations and code. How come the vxWorks compiler accepts it then?

Currently only use block line comment is enough. long long is supported

@lygstate
Copy link
Author

The header is present, it's just the header with -ansi option

@eyalroz
Copy link
Owner

eyalroz commented Dec 15, 2023

Currently only use block line comment is enough. long long is supported

So, what you're asking is not C89 support, nor C90 support. Perhaps we can accommodate your compiler by some kind of CMakeLists.txt check, that would add an appropriate flag for // comment support?

@lygstate
Copy link
Author

Currently only use block line comment is enough. long long is supported

So, what you're asking is not C89 support, nor C90 support. Perhaps we can accommodate your compiler by some kind of CMakeLists.txt check, that would add an appropriate flag for // comment support?

Yeap, it's a -ansi option. I've seen a lot more compiling warning, I think achieve that would receive broader usage

@eyalroz
Copy link
Owner

eyalroz commented Dec 17, 2023

Yeap, it's a -ansi option

I think you've misread what I've written. The -ansi option, at least with compilers such as clang and gcc, does not add support for anything; it is essentially equivalent to -std=c90, which contradicts std=c99, and restricts rather than relaxing constraints.

At any rate, it remains unclear to me what you are asking and for purpose.

@lygstate
Copy link
Author

lygstate commented Jul 3, 2024

Yeap, it's a -ansi option

I think you've misread what I've written. The -ansi option, at least with compilers such as clang and gcc, does not add support for anything; it is essentially equivalent to -std=c90, which contradicts std=c99, and restricts rather than relaxing constraints.

At any rate, it remains unclear to me what you are asking and for purpose.

I am trying to use it within very old system such as VxWorks( and change the compiler option is not accepted) That's why I am trying to do c89 compat(Not allow //) comment

@eyalroz
Copy link
Owner

eyalroz commented Jul 3, 2024

I would consider a pull request which adds C89 support, if significant changes are #ifdef'ed ...

@eyalroz
Copy link
Owner

eyalroz commented Jul 19, 2024

There are other C90 limitations that the PR does not address.

eyalroz pushed a commit that referenced this issue Jul 19, 2024
…C99-style single-line comments (`//`)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
eyalroz pushed a commit that referenced this issue Jul 19, 2024
…C99-style single-line comments (`//`)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
eyalroz pushed a commit that referenced this issue Jul 19, 2024
…C99-style single-line comments (`//`)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
@lygstate
Copy link
Author

There are other C90 limitations that the PR does not address.

Yeap, if change all would be a large , thank you for working on this, I am busy on other things

@eyalroz eyalroz changed the title Enable C89 support Make the library C89-compatible Jul 24, 2024
@eyalroz eyalroz added the task label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants