You should be able to eliminate the warning by simply linking a pre-compiled DCU instead of recompiling the PAS file.
But...
There's nothing wrong with modifying third-party code to fix the warning. I've encountered a number of small deficiencies in DUnit that I chose to fix in the original units.
Advice for making changes to DUnit:
- Don't modify the files in the installation folder.
- Rather make a copy to a new location, and refer your projects to the new location.
- You'll want the new location under source control (as with any other source).
- This allows you to keep a record of any changes you do make; so if you get an update of DUnit, you can easily reapply your custom changes.
- Of course you might want to keep changes made directly in DUnit files to a minimum so as to reduce effort of updating the library. I.e. For each considered change to DUnit, figure out if there might be a suitable alternate way to effect the change without direct modifications.
EDIT
With regard your concern about other developers and the build machines: All the more reason to get the change under you shared source-control.