#68078 closed defect (fixed)

rb-calendar @1.11r: error: call to undeclared library function 'strcmp'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: rb-calendar

Description

https://build.macports.org/builders/ports-13_arm64-builder/builds/33666/steps/install-port/logs/stdio

getdate.c:16:14: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
extern char *getenv();
             ^
getdate.y:456:19: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
extern struct tm        *gmtime ();
                         ^
getdate.y:457:19: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
extern struct tm        *localtime ();
                         ^
getdate.y:458:16: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
extern time_t           mktime ();
                        ^
getdate.y:649:1: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
yyerror (s)
^
getdate.y:86:17: note: expanded from macro 'yyerror'
#define yyerror gd_error
                ^
getdate.y:656:1: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
ToHour (Hours, Meridian)
^
getdate.y:685:1: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
ToYear (Year)
^
getdate.y:716:7: error: call to undeclared library function 'strcmp' with type 'int (const char *, const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0)
      ^
getdate.y:716:7: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
getdate.y:728:7: error: call to undeclared library function 'strlen' with type 'unsigned long (const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  if (strlen (buff) == 3)
      ^
getdate.y:728:7: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
getdate.y:742:8: error: call to undeclared library function 'strncmp' with type 'int (const char *, const char *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
          if (strncmp (buff, tp->name, 3) == 0)
              ^
getdate.y:742:8: note: include the header <string.h> or explicitly provide a declaration for 'strncmp'
getdate.y:702:1: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
LookupWord (buff)
^
getdate.y:934:7: error: call to undeclared function 'gd_parse'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  if (yyparse ()
      ^
getdate.y:84:17: note: expanded from macro 'yyparse'
#define yyparse gd_parse
                ^
8 warnings and 4 errors generated.

See WimplicitFunctionDeclaration.

Change History (2)

comment:1 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)

rb-calendar 1.11r is from 2002.

A newer version 1.11.4r is available from 2008 but it still has this issue.

getdate.y is in gnulib and has been renamed to parse-datetime.y. Probably these issues have been fixed along the way and we can backport the fixes.

One problem, for example, is that getdate.y only includes <string.h> if STDC_HEADERS is defined, but nothing causes it to be defined. gnulib fixed that in 2003 but rb-calendar did not pick up that change.

comment:2 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 43f94e49463ab1d2143da1886397db243e71292d/macports-ports (master):

rb-calendar: Fix implicit funcs; use memcpy

Closes: #68078

Note: See TracTickets for help on using tickets.