Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#68320 closed defect (fixed)

warning: a function declaration without a prototype is deprecated in all versions of C

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: chrstphrchvz (Christopher Chavez)
Priority: Normal Milestone:
Component: base Version: 2.8.99
Keywords: ventura Cc: neverpanic (Clemens Lang), chrstphrchvz (Christopher Chavez)
Port:

Description

Running the MacPorts base tests on Ventura reminds us of a number of problems:

tests/empty.c:1:9: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void foo() {}
        ^
         void
tests/libmachista-test.c:347:9: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int main() {
        ^
         void
./../darwintrace.h:98:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void __darwintrace_setup();
                        ^
                         void
./../darwintrace.h:106:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void __darwintrace_close();
                        ^
                         void
./../darwintrace.h:176:39: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
static inline FILE *__darwintrace_sock() {
                                      ^
                                       void
./../darwintrace.h:195:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void __darwintrace_setup_tls();
                            ^
                             void
./../darwintrace.h:200:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void __darwintrace_store_env();
                            ^
                             void
./../darwintrace.h:207:36: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void __darwintrace_run_constructors() __attribute__((constructor));
                                   ^
                                    void
6 warnings generated.

Change History (4)

comment:1 Changed 13 months ago by chrstphrchvz (Christopher Chavez)

Fix proposed in https://github.com/macports/macports-base/pull/302, which also takes care of a few encountered during make all of base (excluding those in vendor):

darwintrace.c:179:41: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  179 | static inline void __darwintrace_tid_set() {
      |                                         ^
      |                                          void
darwintrace.c:293:38: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  293 | static void __darwintrace_get_filemap() {
      |                                      ^
      |                                       void
darwintrace.c:742:24: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  742 | static path_t *path_new() {
      |                        ^
      |                         void
main.c:411:15: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  411 | UnmonitorChild()
      |               ^
      |                void
main.c:418:16: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  418 | MonitoringChild()
      |                ^
      |                 void
2 warnings generated.

comment:2 Changed 13 months ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:3 Changed 13 months ago by chrstphrchvz (Christopher Chavez)

Owner: set to chrstphrchvz
Resolution: fixed
Status: newclosed

In 3c5e6523d2855497ad5530edf88a325f9cad6a7e/macports-base (master):

Specify void parameter in function declarators

Fixes: #68320

comment:4 Changed 13 months ago by neverpanic (Clemens Lang)

Thanks, you beat me to that!

Note: See TracTickets for help on using tickets.