Bug 136789

Summary: freesci-0.3.4c-5: undefined C code
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Mads Martin Joergensen <mmj>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2005-12-02 22:31:48 UTC
I just tried to compile package freesci-0.3.4c-5 with a prerelease of the
GNU C compiler version 4.1. It said

said.y:358: warning: operation on `said_tree_pos' may be undefined

The source code is

        retval = said_branch_node(SAID_NEXT_NODE,
                                  said_branch_node(SAID_NEXT_NODE,
                                                   said_leaf_node(SAID_NEXT_NODE, n1),
                                                   said_branch_node(SAID_NEXT_NODE,
                                                                    said_leaf_node(SAID_NEXT_NODE, n2),
                                                                    t1
                                                                    )
                                                   ),
                                  t2
                                  );

but

#define SAID_NEXT_NODE ((said_tree_pos == 0) || (said_tree_pos >= VOCAB_TREE_NODES))? said_tree_pos
= 0 : said_tree_pos++

I agree with the compiler - this code seems to be undefined. 

In C, there are no guarantees that side effects are computed left to
right in one expression.

Suggest code rework. BTW, the email address of the author [ 
creichen@rbg.informatik.tu-darmstadt.de ] seems to be broken.
Comment 1 Mads Martin Joergensen 2005-12-14 12:19:54 UTC
How did you compile it? 
Comment 2 Mads Martin Joergensen 2005-12-14 12:23:44 UTC
ah, I see. Well, freesci is a leaf package and this haven't really proven to have any implications at all, so until this happens we'll keep it.
Comment 3 David Binderman 2005-12-14 18:47:37 UTC
>this haven't really proven to have any implications at all

This is the first package, of hundreds in Suse Linux, where I've
heard a developer say this. 

All the other developers are happy to fix undefined code.

Entirely your choice.