Clear waring in tests and benchmarks.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Clear waring in tests and benchmarks.

Joaquim Duran
I would like to clear some warning that appears when compiling the
tests and benchmarks and improve code organization:

1 - add a macro named NOT_USED (in utils.hpp) to mark tell to the
compiler that a variable that has been assigned a value, it 'll not be
used.

#define NOT_USED(x) (void)(x)

matrix m, a, b;
m = a * b;
NOT_USED(m);

NOTE: some tests already avoid this warning.

2 - Remove unused parameters, specially to 'main' functions.

3 - Three tests uses the template function mean_square. This function
could be placed to a header file.

Joaquim Duran
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Clear waring in tests and benchmarks.

David Bellot
Hi Joaquim,

sure, it sounds like a good idea. Whenever your patch is ready, please submit a pull request on ublas/develop. It's open again for changes towards 1.58

Best,
David

On Sat, Oct 18, 2014 at 1:21 AM, Joaquim Duran <[hidden email]> wrote:
I would like to clear some warning that appears when compiling the
tests and benchmarks and improve code organization:

1 - add a macro named NOT_USED (in utils.hpp) to mark tell to the
compiler that a variable that has been assigned a value, it 'll not be
used.

#define NOT_USED(x) (void)(x)

matrix m, a, b;
m = a * b;
NOT_USED(m);

NOTE: some tests already avoid this warning.

2 - Remove unused parameters, specially to 'main' functions.

3 - Three tests uses the template function mean_square. This function
could be placed to a header file.

Joaquim Duran
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]


_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Clear waring in tests and benchmarks.

Nasos Iliopoulos
Joaquim,
please just rename it to BOOST_UBLAS_NOT_USED.

-Nasos

On 10/20/2014 03:13 AM, David Bellot wrote:
Hi Joaquim,

sure, it sounds like a good idea. Whenever your patch is ready, please submit a pull request on ublas/develop. It's open again for changes towards 1.58

Best,
David

On Sat, Oct 18, 2014 at 1:21 AM, Joaquim Duran <[hidden email]> wrote:
I would like to clear some warning that appears when compiling the
tests and benchmarks and improve code organization:

1 - add a macro named NOT_USED (in utils.hpp) to mark tell to the
compiler that a variable that has been assigned a value, it 'll not be
used.

#define NOT_USED(x) (void)(x)

matrix m, a, b;
m = a * b;
NOT_USED(m);

NOTE: some tests already avoid this warning.

2 - Remove unused parameters, specially to 'main' functions.

3 - Three tests uses the template function mean_square. This function
could be placed to a header file.

Joaquim Duran
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]



_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]


_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Clear waring in tests and benchmarks.

Nasos Iliopoulos
In reply to this post by Joaquim Duran
Regarding mean_square we should probably replace it with a stronger
check like maybe the square of the Frobenius norm and yes make it a
common util for the tests.

-Nasos


On 10/17/2014 08:21 PM, Joaquim Duran wrote:

> I would like to clear some warning that appears when compiling the
> tests and benchmarks and improve code organization:
>
> 1 - add a macro named NOT_USED (in utils.hpp) to mark tell to the
> compiler that a variable that has been assigned a value, it 'll not be
> used.
>
> #define NOT_USED(x) (void)(x)
>
> matrix m, a, b;
> m = a * b;
> NOT_USED(m);
>
> NOTE: some tests already avoid this warning.
>
> 2 - Remove unused parameters, specially to 'main' functions.
>
> 3 - Three tests uses the template function mean_square. This function
> could be placed to a header file.
>
> Joaquim Duran
> _______________________________________________
> ublas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [hidden email]

_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]