On Thursday, February 18, 2016 03:23:26 PM Stefan Esser wrote:
> Author: se
> Date: Thu Feb 18 15:23:25 2016
> New Revision: 295760
> URL: https://svnweb.freebsd.org/changeset/base/295760
> 
> Log:
>   Make WARNS=6 safe.
>   
>   Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64.

Thanks.

> Modified: head/usr.sbin/pciconf/cap.c
> ==============================================================================
> --- head/usr.sbin/pciconf/cap.c       Thu Feb 18 15:12:52 2016        
> (r295759)
> +++ head/usr.sbin/pciconf/cap.c       Thu Feb 18 15:23:25 2016        
> (r295760)
> @@ -120,6 +120,9 @@ static void
>  cap_vpd(int fd, struct pci_conf *p, uint8_t ptr)
>  {
>  
> +     (void)fd;       /* UNUSED */
> +     (void)p;        /* UNUSED */
> +     (void)ptr;      /* UNUSED */
>       printf("VPD");
>  }

I think we prefer __unused in the parameter declaration instead?  That is:

cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused)

> @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin
>       }
>       if ((p->pc_hdr & PCIM_HDRTYPE) == 1)
>               return;
> +     max_burst_read = 0;
>       switch (status & PCIXM_STATUS_MAX_READ) {
>       case PCIXM_STATUS_MAX_READ_512:
>               max_burst_read = 512;

Compilers are simply not smart enough. :-P

> Modified: head/usr.sbin/pciconf/pciconf.c
> ==============================================================================
> --- head/usr.sbin/pciconf/pciconf.c   Thu Feb 18 15:12:52 2016        
> (r295759)
> +++ head/usr.sbin/pciconf/pciconf.c   Thu Feb 18 15:23:25 2016        
> (r295760)
> @@ -913,7 +915,8 @@ parsesel(const char *str)
>               ep += 3;
>               i = 0;
>               do {
> -                     selarr[i++] = strtoul(ep, &ep, 10);
> +               selarr[i++] = strtoul(ep, &eppos, 10);
> +               ep = eppos;
>               } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4);

This is now indented oddly (2 spaces instead of a tab?).

-- 
John Baldwin
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to