[Webnucleo-bugs] Example bug report (Bugs in example1.c in wn_matrix, version 0.2)

Bradley S. Meyer mbradle at clemson.edu
Sun Jul 15 17:37:01 EDT 2007


The following shows an example bug report that can serve as a template for
other such reports.  Notice that it clearly states:

1) The module, version, and specific code.
2) How to reproduce the error.
3) How to fix the code.  (This last step is not necessary for a bug report
but is a great help if you can track the bug(s) down.)

The reply to this message will show the kind of reply you can expect.

============ Sample bug report =====================================

Hello,

When I compile example1.c in the src/examples directory of wn_matrix
version 0.2 with gcc with the added compiler flags

-Werror -Wconversion -Wstrict-prototypes

(I attach the Makefile that I used), I get the following compilation errors:

example1.c:46: warning: function declaration isn't a prototype
example1.c: In function `main':
example1.c:162: warning: passing arg 4 of `WnMatrix__assignElement' as
floating rather than integer due to prototype
example1.c:193: warning: passing arg 4 of `WnMatrix__assignElement' as
floating rather than integer due to prototype
make: *** [tmp/example1.o] Error 1

The errors are due to the main prototype and the fact that example1.c is
passing an int in two places where it should pass a double.

I have a new version of example1.c (called example1_new.c) that compiles
correctly with the new flags.  When I run

diff example1.c example1_new.c

I get the changes:

46c46
< int main() {
---
> int main( void ) {
162c162
<   WnMatrix__assignElement( p_my_matrix, 1, 1, 1 );
---
>   WnMatrix__assignElement( p_my_matrix, 1, 1, 1. );
193c193
<   WnMatrix__assignElement( p_my_matrix, 1, 1, 1 );
---
>   WnMatrix__assignElement( p_my_matrix, 1, 1, 1. );

Thanks, and best wishes.

John Q. BugReporter

=========== Example bug report ==========================


-- 
Bradley S. Meyer
Department of Physics and Astronomy
Clemson University
Clemson, SC 29634-0978
mbradle at clemson.edu
http://nucleo.ces.clemson.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 4993 bytes
Desc: not available
Url : https://mail.clemson.edu/pipermail/webnucleo-bugs/attachments/20070715/726625a8/attachment.obj 


More information about the Webnucleo-bugs mailing list