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

interface: fix clang -Wstrict-prototypes warnings for C interface #651

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zyv
Copy link

@zyv zyv commented Jul 28, 2024

I'm getting the following warnings on macOS:

zaytsev@Yurys-MBP aspell % clang -v
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
/opt/homebrew/include/aspell.h:102:40: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
struct AspellConfig * new_aspell_config();
                                       ^
                                        void
/opt/homebrew/include/aspell.h:195:35: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char * aspell_version_string();
                                  ^
                                   void
/opt/homebrew/include/aspell.h:673:49: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
struct AspellStringList * new_aspell_string_list();
                                                ^
                                                 void
/opt/homebrew/include/aspell.h:703:47: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
struct AspellStringMap * new_aspell_string_map();
                                              ^
                                               void

I've only got a very superficial understanding of the interface generator, and with my changes, the C interface file now comes out clean. I didn't check any other languages. Appreciate your guidance if I did anything wrong.

```
/opt/homebrew/include/aspell.h:102:40: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
struct AspellConfig * new_aspell_config();
                                       ^
                                        void
/opt/homebrew/include/aspell.h:195:35: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char * aspell_version_string();
                                  ^
                                   void
/opt/homebrew/include/aspell.h:673:49: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
struct AspellStringList * new_aspell_string_list();
                                                ^
                                                 void
/opt/homebrew/include/aspell.h:703:47: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
struct AspellStringMap * new_aspell_string_map();
                                              ^
                                               void
```
kevina added a commit that referenced this pull request Jul 30, 2024
@kevina
Copy link
Member

kevina commented Jul 30, 2024

Thanks for pointing this out. A better way would be to fix the Perl scripts as I did in the fix-651 branch. I just need to review the generated code and make sure it doesn't do anything unexpected.

@zyv
Copy link
Author

zyv commented Jul 30, 2024

Hi Kevin,

Thanks for looking into it! Your approach of fixing the generator instead is, of course, a superior one. It's just that this type of Perl-fu is over my head, especially not being familiar with how the generator works. I understand what you did though, and it looks legit.

All the best,
Yury

@zyv
Copy link
Author

zyv commented Oct 26, 2024

Any ideas when this is going to be included? It prevents us from building mc with --enable-werror...

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