Bug 176424 - Compiler warning, TARGET_ARCH=armv6, make MALLOC_PRODUCTION=yes buildworld
Summary: Compiler warning, TARGET_ARCH=armv6, make MALLOC_PRODUCTION=yes buildworld
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: 9.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 18:40 UTC by josla972
Modified: 2013-09-11 19:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description josla972 2013-02-25 18:40:00 UTC
When doing make MALLOC_PRODUCTION=yes buildworld, a compiler warning will be issued which halts compilation. The warning is issued because line 463 of head/sbin/fsck_ffs/fsutil.c uses "%ld" and "%lld", for variables of type time_t, which I think are of the type int in this case when compiling for armv6.

Fix: 

Typecasting like this solved the problem:

printf("%21s:%8ld %2ld.%ld%% %8lld msec %2lld.%lld%%\n", buftype[i], (long)readcnt[i], (long) readcnt[i] * 100 / diskreads, (long) (readcnt[i] * 1000 / diskreads) % 10, (long long) msec, (long long) msec * 100 / totalmsec, (long long) (msec * 1000 / totalmsec) % 10);
How-To-Repeat: Following this guide to step 13 should do the trick:
http://ogris.de/howtos/freebsd-raspberry.html
Comment 1 Ian Lepore freebsd_committer freebsd_triage 2013-02-25 19:08:22 UTC
On Mon, 2013-02-25 at 18:32 +0000, Josef Larsson wrote:
> >Number:         176424
> >Category:       arm
> >Synopsis:       Compiler warning, TARGET_ARCH=armv6, make MALLOC_PRODUCTION=yes buildworld
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       low
> >Responsible:    freebsd-arm
> >State:          open
> >Quarter:        
> >Keywords:       
> >Date-Required:
> >Class:          sw-bug
> >Submitter-Id:   current-users
> >Arrival-Date:   Mon Feb 25 18:40:00 UTC 2013
> >Closed-Date:
> >Last-Modified:
> >Originator:     Josef Larsson
> >Release:        FreeBSD server 9.1-RELEASE
> >Organization:
> >Environment:
> FreeBSD server 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
> >Description:
> When doing make MALLOC_PRODUCTION=yes buildworld, a compiler warning will be issued which halts compilation. The warning is issued because line 463 of head/sbin/fsck_ffs/fsutil.c uses "%ld" and "%lld", for variables of type time_t, which I think are of the type int in this case when compiling for armv6. 
> >How-To-Repeat:
> Following this guide to step 13 should do the trick:
> http://ogris.de/howtos/freebsd-raspberry.html
> >Fix:
> Typecasting like this solved the problem:
> 
> printf("%21s:%8ld %2ld.%ld%% %8lld msec %2lld.%lld%%\n", buftype[i], (long)readcnt[i], (long) readcnt[i] * 100 / diskreads, (long) (readcnt[i] * 1000 / diskreads) % 10, (long long) msec, (long long) msec * 100 / totalmsec, (long long) (msec * 1000 / totalmsec) % 10);

FYI, this was fixed with r247269.

Also, there's no need to use MALLOC_PRODUCTION anymore, a change about a
month ago fixed the performance and memory-hogging problems.

-- Ian
Comment 2 Luiz Otavio O Souza,+55 (14) 99772-1255 freebsd_committer freebsd_triage 2013-09-11 19:15:13 UTC
State Changed
From-To: open->closed

Closing this PR.  The issue was fixed in r247269.  Thanks!