Bug 207134 - graphics/libfpx: fix build with clang 3.8.0
Summary: graphics/libfpx: fix build with clang 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 206074
  Show dependency treegraph
 
Reported: 2016-02-12 18:15 UTC by Dimitry Andric
Modified: 2016-02-19 03:18 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (freebsd-2024)


Attachments
Fix infinite loop in libfpx's EB_Copy_To_Memory() function (1.04 KB, patch)
2016-02-12 18:15 UTC, Dimitry Andric
mi: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-02-12 18:15:15 UTC
Created attachment 166903 [details]
Fix infinite loop in libfpx's EB_Copy_To_Memory() function

During a recent exp-run for bug 206074, it was found that graphics/libfpx gives errors with clang 3.8.0:

/wrkdirs/usr/ports/graphics/libfpx/work/libfpx-1.3.1-4/jpeg/ebuffer.c:94:36: error: variables 'i' and 'num' used in loop condition not modified in loop body [-Werror,-Wfor-loop-analysis]
  for(i=0,mem_ptr=mem,buf_ptr=buf; i < num ;*mem_ptr++=*buf_ptr++);
                                   ^   ~~~

This for loop, in the EB_Copy_To_Memory() function, is non-terminating, since it never increases its counter.  The attached patch fixes this.

[1] http://package22.nyi.freebsd.org/data/headamd64PR206074-default/2016-02-12_13h52m56s/logs/errors/libfpx-1.3.1.4.log
Comment 1 Mikhail Teterin freebsd_committer freebsd_triage 2016-02-17 04:30:18 UTC
Comment on attachment 166903 [details]
Fix infinite loop in libfpx's EB_Copy_To_Memory() function

I'd like to look deeper -- how could this code have ever worked? And, if it was never, actually, exercised, simply remove it altogether, instead of dressing it up...
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-02-19 03:17:24 UTC
A commit references this bug:

Author: mi
Date: Fri Feb 19 03:16:43 UTC 2016
New revision: 409147
URL: https://svnweb.freebsd.org/changeset/ports/409147

Log:
  Add a patch to get rid of some dead code, which triggers a
  warning when compiled with clang-3.8. Bump PORTREVISION.

  PR:		207134

Changes:
  head/graphics/libfpx/Makefile
  head/graphics/libfpx/files/patch-ebuffer