ports/171266: [patch] fix build of audio/cam with clang

Pawel Worach pawel.worach at gmail.com
Sun Sep 2 22:40:04 UTC 2012


>Number:         171266
>Category:       ports
>Synopsis:       [patch] fix build of audio/cam with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 02 22:40:04 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Pawel Worach
>Release:        FreeBSD 10.0-CURRENT
>Organization:
>Environment:
>Description:
$FreeBSD: ports/audio/cam/Makefile,v 1.14 2005/04/19 08:51:43 vs Exp $

clang -O2 -pipe -fno-strict-aliasing -c cam.c
cam.c:29:1: error: 'main' must return 'int'
void main(int argc, char *argv[])
^
cam.c:40:6: warning: implicitly declaring C library function 'exit' with type 'void (int) __attribute__((noreturn))'
     exit(0);
     ^
cam.c:40:6: note: please include the header <stdlib.h> or explicitly provide a declaration for 'exit'
1 warning and 1 error generated.
*** Error code 1
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN cam.orig/files/patch-cam.c cam/files/patch-cam.c
--- cam.orig/files/patch-cam.c	1970-01-01 01:00:00.000000000 +0100
+++ cam/files/patch-cam.c	2012-09-03 00:31:57.000000000 +0200
@@ -0,0 +1,14 @@
+--- cam.c.orig	2012-09-03 00:31:15.000000000 +0200
++++ cam.c	2012-09-03 00:31:42.000000000 +0200
+@@ -24,9 +24,10 @@
+ 
+ 
+ 
++#include <stdlib.h>
+ #include "cam.h"
+ 
+-void main(int argc, char *argv[])
++int main(int argc, char *argv[])
+ {
+   if (argc == 1)
+   {   


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list