Bug 36 - drivers/bus/pci/linux/pci_vfio.c does not compile when compilation strictly fails on warnings
Summary: drivers/bus/pci/linux/pci_vfio.c does not compile when compilation strictly f...
Status: RESOLVED FIXED
Alias: None
Product: DPDK
Classification: Unclassified
Component: ethdev (show other bugs)
Version: 18.05
Hardware: All All
: Normal minor
Target Milestone: ---
Assignee: Anatoly Burakov
URL:
Depends on:
Blocks:
 
Reported: 2018-05-03 12:36 CEST by Raph
Modified: 2018-11-20 16:27 CET (History)
3 users (show)



Attachments

Description Raph 2018-05-03 12:36:30 CEST
This file produces a warning: `dpdk/drivers/bus/pci/linux/pci_vfio.c:38:0: warning: "PAGE_SIZE" redefined`.

This is irritatingly when one is compiling with warnings as errors in order to catch more serious bugs (eg implicit function definitions). One potential fix might be to do:-

```
#undef PAGE_SIZE
#define PAGE_SIZE   (sysconf(_SC_PAGESIZE))
```

But as I'm not clear on the implications, I can't comment further.
Comment 1 Anatoly Burakov 2018-05-03 12:46:11 CEST
DPDK is compiled with all warnings treated as errors by default, so the fact that this hasn't been caught implies you have a non-standard setup that isn't part of our build automation.

I think the fix you suggested should be pretty safe, but a safer fix would be to change the name of this internal define to avoid redefining it in the first place.
Comment 2 Raph 2018-05-03 13:05:55 CEST
Well, if you consider using 'musl' non-standard (;-). [As things stand, DPDK wouldn't compile on an Alpine Linux, say - the most popular container distro de jour].

Given that musl is a stricter, and, arguably, more robust C lib, it'd be a good CI test to run compiles against it regularly.
Comment 3 Ajit Khaparde 2018-07-13 19:33:04 CEST
Raph, Anatoly,
What is the next step on this?

Thanks
Comment 4 Anatoly Burakov 2018-07-16 10:41:55 CEST
The next step would be to fix this :) I've completely forgot about this issue, but i'll send a patch to fix it.
Comment 5 Ajit Khaparde 2018-08-02 22:49:40 CEST
Over to Anatoly based on comment#4. Thanks
Comment 6 Anatoly Burakov 2018-08-29 13:57:59 CEST
Patch submitted:

http://patches.dpdk.org/patch/43971/
Comment 7 Anatoly Burakov 2018-11-20 16:27:18 CET
The patches have been merged.

Note You need to log in before you can comment on or make changes to this bug.