GNUAspell / aspell

http://aspell.net
GNU Lesser General Public License v2.1
243 stars 53 forks source link

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

Open zyv opened 3 months ago

zyv commented 3 months ago

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.

kevina commented 3 months ago

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 commented 3 months ago

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 commented 4 weeks ago

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