home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!usc!sdd.hp.com!uakari.primate.wisc.edu!ames!olivea!sgigate!sgiblab!ultra!jimh
- From: jimh@ultra.com (Jim Hurley)
- Newsgroups: comp.lang.c
- Subject: Help with function typedef.
- Message-ID: <1992Aug14.223459.2638@ultra.com>
- Date: 14 Aug 92 22:34:59 GMT
- Organization: Ultra Network Technologies
- Lines: 39
-
- I don't understand what's happening here, can anyone help?
-
- File x.c (between the dahed lines):
- --------------------------------------------
- typedef unsigned char CLI_RETURN_CODE;
-
- typedef CLI_RETURN_CODE (*CLI) (int, char **);
-
- typedef struct {
- char * command_name;
- char * command_description;
- CLI command_entry;
- } CLI_Command_Table;
-
- /* prototype */
- CLI cli_help;
-
-
- CLI_Command_Table cli_command_table[] = {
- "help", "List available commands", cli_help
- };
-
-
- CLI_RETURN_CODE cli_help (int argc, char **argv) {
-
- /* nothing yet */
-
- }
- --------------------------------------------
- Compilation results:
-
- gcc -c x.c
- x.c:17: initializer for static variable is not constant
- x.c: In function cli_help:
- x.c:20: `cli_help' redeclared as different kind of symbol
- x.c:12: previous declaration of `cli_help'
- --
- Jim Hurley --> jimh@ultra.com ...!ames!ultra!jimh (408) 922-0100
- Ultra Network Technologies / 101 Daggett Drive / San Jose CA 95134
-