Bug 193112 - i386 compilation errors in head/sys/dev/ixl/if_ixl.c
Summary: i386 compilation errors in head/sys/dev/ixl/if_ixl.c
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: i386 Any
: Normal Affects Some People
Assignee: Bjoern A. Zeeb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-29 06:11 UTC by David Shao
Modified: 2014-08-29 09:41 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Shao 2014-08-29 06:11:41 UTC
Compilation errors occur in head/sys/dev/ixl/if_ixl.c on i386 for
FreeBSD 11-current

$ svn info
...
URL: http://svn.freebsd.org/base/head
Relative URL: ^/head
Repository Root: http://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 270779
Node Kind: directory
Schedule: normal
Last Changed Author: jfv
Last Changed Rev: 270775
Last Changed Date: 2014-08-28 17:33:31 -0700 (Thu, 28 Aug 2014)

for the following:

In function ixl_print_debug_info()

        printf("Queue irqs = %lx\n", que->irqs);
        printf("AdminQ irqs = %lx\n", pf->admin_irq);
...
        printf("RX not ready = %lx\n", rxr->not_done);
        printf("RX packets = %lx\n", rxr->rx_packets);

all cause
error: format specifies type 'unsigned long' but the argument has type
'u64' (aka 'unsigned long long') [-Werror,-Wformat]

In function ixl_stat_update48(struct i40e_hw *hw, u32 hireg, u32 loreg,
        bool offset_loaded, u64 *offset, u64 *stat)


#if __FreeBSD__ >= 10 && __amd64__

causes
error:  '__amd64__' is not defined, evaluates to 0 [-Werror,-Wundef]
Comment 1 commit-hook freebsd_committer freebsd_triage 2014-08-29 09:37:34 UTC
A commit references this bug:

Author: bz
Date: Fri Aug 29 09:37:18 UTC 2014
New revision: 270799
URL: http://svnweb.freebsd.org/changeset/base/270799

Log:
  First try on fixing some more compile errors without actually testing:
  - use proper __FreeBSD_version check and more importantly check for __am64__
    to be defined.  Whether the FreeBSD(_version) checks are needed is a
    different question.
  - cast uint64_t to uintmax_t and use %jx for printing.

  Note: there are more values that could be printed in that status function
  	but leave that for the future;  printf doesn't seem to be the right
  	way to do it anyway.
  Note: there is more breakage related to i40e_allocate_dma*() having
  	conflicting declarations, so more fixes to come.

  PR:		193112
  MFC after:	3 days
  X-MFC with:	r270755

Changes:
  head/sys/dev/ixl/if_ixl.c
Comment 2 Bjoern A. Zeeb freebsd_committer freebsd_triage 2014-08-29 09:41:00 UTC
People were aware of this (see follow-up emails to the commit message);  thanks a lot for catching it and reporting however.  In general reporting HEAD compile errors to freebsd-current or as a follow-up to the commit message is more efficient than via the bug system.