Bug 171266 - [patch] fix build of audio/cam with clang
Summary: [patch] fix build of audio/cam with clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Raphael Kubo da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-02 23:40 UTC by Pawel Worach
Modified: 2012-09-23 19:40 UTC (History)
0 users

See Also:


Attachments
file.diff (476 bytes, patch)
2012-09-02 23:40 UTC, Pawel Worach
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Worach 2012-09-02 23:40:04 UTC
$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

Fix: Patch attached with submission follows:
Comment 1 Raphael Kubo da Costa freebsd_committer freebsd_triage 2012-09-03 10:29:06 UTC
Are you building with -Werror or something? I tried building the port
with clang and these errors were only warnings here.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2012-09-13 12:54:52 UTC
Raphael Kubo da Costa <rakuco@FreeBSD.org> writes:

> Are you building with -Werror or something? I tried building the port
> with clang and these errors were only warnings here.

The error is specific to clang-3.0 on 9.0R. It doesn't happen on
clang-3.1 present in /stable/9 (also lang/clang) and clang-3.2 present in
/head (also lang/clang-devel).

http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.9-exp-clang.20120902011351.pointyhat-west/cam-1.02.log
Comment 3 Raphael Kubo da Costa freebsd_committer freebsd_triage 2012-09-23 19:31:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rakuco

OK, thanks for the information. Will commit it now.
Comment 4 Raphael Kubo da Costa freebsd_committer freebsd_triage 2012-09-23 19:35:48 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 5 dfilter service freebsd_committer freebsd_triage 2012-09-23 19:36:04 UTC
Author: rakuco
Date: Sun Sep 23 18:35:49 2012
New Revision: 304761
URL: http://svn.freebsd.org/changeset/ports/304761

Log:
  Fix the build with clang 3.0 from 9.0-RELEASE.
  
  See [1] for the build log, more recent clang versions already work
  fine.
  
  [1] http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.9-exp-clang.20120902011351.pointyhat-west/cam-1.02.log
  
  PR:		ports/171266
  Submitted by:	Pawel Worach <pawel.worach@gmail.com>

Added:
  head/audio/cam/files/patch-cam.c   (contents, props changed)

Added: head/audio/cam/files/patch-cam.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/cam/files/patch-cam.c	Sun Sep 23 18:35:49 2012	(r304761)
@@ -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)
+   {
\ No newline at end of file
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"