Treat warnings as errors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Treat warnings as errors

Noel O'Boyle
Administrator
Hi all,

Over the last year, several developers have spent time fixing warnings
reported by various tools. This sort of maintenance is best done by
the original developer at the point of commiting. Warnings are fairly
easy to fix and knowing about them improves programming skills.

An easy way to make this happen as a normal part of the Github merge
process is to increase the GCC warning level (we use -Wall here at
work) and tell gcc to treat warnings as errors. It will then stop at
the first warning, and will be visible as a build failure on Github.

An obvious prerequisite for this would be to ensure that the current
code builds without warnings but this can be sorted out.

Thoughts?
- Noel

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Treat warnings as errors

Geoff Hutchison
My big concern would be the inchi code, which has tons. If we do this for our C++ and Python, I think it's a good goal.

Geoff

> On Jun 23, 2016, at 4:39 AM, Noel O'Boyle <[hidden email]> wrote:
>
> Hi all,
>
> Over the last year, several developers have spent time fixing warnings
> reported by various tools. This sort of maintenance is best done by
> the original developer at the point of commiting. Warnings are fairly
> easy to fix and knowing about them improves programming skills.
>
> An easy way to make this happen as a normal part of the Github merge
> process is to increase the GCC warning level (we use -Wall here at
> work) and tell gcc to treat warnings as errors. It will then stop at
> the first warning, and will be visible as a build failure on Github.
>
> An obvious prerequisite for this would be to ensure that the current
> code builds without warnings but this can be sorted out.
>
> Thoughts?
> - Noel
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> OpenBabel-Devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-devel

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Treat warnings as errors

Noel O'Boyle
Administrator
Hopefully we can put some pragmas in the InChI code or do some other
hack (e.g. google says "-isystem") to suppress warnings from those.
Alternatively, we could use a prebuilt InChI library for the purposes
of this build.

- Noel

On 23 June 2016 at 13:17, Geoff Hutchison <[hidden email]> wrote:

> My big concern would be the inchi code, which has tons. If we do this for our C++ and Python, I think it's a good goal.
>
> Geoff
>
>> On Jun 23, 2016, at 4:39 AM, Noel O'Boyle <[hidden email]> wrote:
>>
>> Hi all,
>>
>> Over the last year, several developers have spent time fixing warnings
>> reported by various tools. This sort of maintenance is best done by
>> the original developer at the point of commiting. Warnings are fairly
>> easy to fix and knowing about them improves programming skills.
>>
>> An easy way to make this happen as a normal part of the Github merge
>> process is to increase the GCC warning level (we use -Wall here at
>> work) and tell gcc to treat warnings as errors. It will then stop at
>> the first warning, and will be visible as a build failure on Github.
>>
>> An obvious prerequisite for this would be to ensure that the current
>> code builds without warnings but this can be sorted out.
>>
>> Thoughts?
>> - Noel
>>
>> ------------------------------------------------------------------------------
>> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
>> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
>> present their vision of the future. This family event has something for
>> everyone, including kids. Get more information and register today.
>> http://sdm.link/attshape
>> _______________________________________________
>> OpenBabel-Devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-devel

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Treat warnings as errors

Geoff Hutchison
> Hopefully we can put some pragmas in the InChI code or do some other
> hack (e.g. google says "-isystem") to suppress warnings from those.


Since all the InChI code is C, but ours is C++, it’s a matter of setting CXXFLAGS differently than CFLAGS. I already do this for warnings.

-Geoff


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Loading...