Mercurial > pidgin
comparison src/getopt.h @ 12323:fc464a0abccc
[gaim-migrate @ 14627]
Function prototypes need to be of the form foo(void); instead of foo(); for function that don't take any arguments. This allows the compiler to detect mistakes were someone passes arguments to such a function.
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Sun, 04 Dec 2005 18:19:56 +0000 |
| parents | c0961d8cb0fb |
| children | 0d4484b7a46a |
comparison
equal
deleted
inserted
replaced
| 12322:c7ae1fd0827d | 12323:fc464a0abccc |
|---|---|
| 106 /* Many other libraries have conflicting prototypes for getopt, with | 106 /* Many other libraries have conflicting prototypes for getopt, with |
| 107 differences in the consts, in stdlib.h. To avoid compilation | 107 differences in the consts, in stdlib.h. To avoid compilation |
| 108 errors, only prototype getopt for the GNU C library. */ | 108 errors, only prototype getopt for the GNU C library. */ |
| 109 extern int getopt (int argc, char *const *argv, const char *shortopts); | 109 extern int getopt (int argc, char *const *argv, const char *shortopts); |
| 110 #else /* not __GNU_LIBRARY__ */ | 110 #else /* not __GNU_LIBRARY__ */ |
| 111 extern int getopt (); | 111 extern int getopt (void); |
| 112 #endif /* not __GNU_LIBRARY__ */ | 112 #endif /* not __GNU_LIBRARY__ */ |
| 113 extern int getopt_long (int argc, char *const *argv, const char *shortopts, | 113 extern int getopt_long (int argc, char *const *argv, const char *shortopts, |
| 114 const struct option *longopts, int *longind); | 114 const struct option *longopts, int *longind); |
| 115 extern int getopt_long_only (int argc, char *const *argv, | 115 extern int getopt_long_only (int argc, char *const *argv, |
| 116 const char *shortopts, | 116 const char *shortopts, |
| 120 extern int _getopt_internal (int argc, char *const *argv, | 120 extern int _getopt_internal (int argc, char *const *argv, |
| 121 const char *shortopts, | 121 const char *shortopts, |
| 122 const struct option *longopts, int *longind, | 122 const struct option *longopts, int *longind, |
| 123 int long_only); | 123 int long_only); |
| 124 #else /* not __STDC__ */ | 124 #else /* not __STDC__ */ |
| 125 extern int getopt (); | 125 extern int getopt (void); |
| 126 extern int getopt_long (); | 126 extern int getopt_long (void); |
| 127 extern int getopt_long_only (); | 127 extern int getopt_long_only (void); |
| 128 | 128 |
| 129 extern int _getopt_internal (); | 129 extern int _getopt_internal (void); |
| 130 #endif /* not __STDC__ */ | 130 #endif /* not __STDC__ */ |
| 131 | 131 |
| 132 #ifdef __cplusplus | 132 #ifdef __cplusplus |
| 133 } | 133 } |
| 134 #endif | 134 #endif |
