Bug 261638 - Fix a Tools/MiniBrowser build failure due to missing stdlib.h header file include statement
Summary: Fix a Tools/MiniBrowser build failure due to missing stdlib.h header file inc...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: All Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-16 03:23 PDT by Guido Trentalancia
Modified: 2023-09-23 03:24 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch to fix the build failure (541 bytes, patch)
2023-09-16 03:23 PDT, Guido Trentalancia
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Trentalancia 2023-09-16 03:23:38 PDT
Created attachment 467698 [details]
Proposed patch to fix the build failure

The latest version of WebKit 2.42.0 fails to build Tools/MiniBrowser/gtk/main.c due to a missing libc stdlib.h header file.

A patch is proposed to add the stdlib.h header file needed by the exit() libc function and fix such build failure.

Here is the build error produced:

/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c: In function ‘parseFeaturesOptionCallback’:
/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c:287:9: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
  287 |         exit(EXIT_SUCCESS);
      |         ^~~~
/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c:44:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
   43 | #include <gst/gst.h>
  +++ |+#include <stdlib.h>
   44 | #endif
/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c:287:9: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  287 |         exit(EXIT_SUCCESS);
      |         ^~~~
/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c:287:9: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c:287:14: error: ‘EXIT_SUCCESS’ undeclared (first use in this function)
  287 |         exit(EXIT_SUCCESS);
      |              ^~~~~~~~~~~~
/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c:287:14: note: ‘EXIT_SUCCESS’ is defined in header ‘<stdlib.h>’; did you forget to ‘#include <stdlib.h>’?
/home/guido/tmp-new/webkitgtk-2.42.0/Tools/MiniBrowser/gtk/main.c:287:14: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Tools/MiniBrowser/gtk/CMakeFiles/MiniBrowser.dir/build.make:182: Tools/MiniBrowser/gtk/CMakeFiles/MiniBrowser.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2067: Tools/MiniBrowser/gtk/CMakeFiles/MiniBrowser.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Comment 1 Radar WebKit Bug Importer 2023-09-23 03:24:12 PDT
<rdar://problem/115930606>