<div dir="ltr"><div dir="ltr">If you want to be thorough, then search the rest of the code for all references to this function.  Look for any call that checks a return code.  Also see if and how the function is defined for public or external use.  If there is any hint of referencing a return code, then declare the return type as "int", and add return (0) at the end of the main part of the function.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr">On Tue, Jul 26, 2022 at 11:28 AM Blair Zajac <<a href="mailto:blair@orcaware.com">blair@orcaware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div>Yes, that would fix it.</div><div><br><blockquote type="cite"><div>On Jul 26, 2022, at 10:27 AM, Mark Brethen <<a href="mailto:mark.brethen@gmail.com" target="_blank">mark.brethen@gmail.com</a>> wrote:</div><br><div><div style="word-wrap:break-word;line-break:after-white-space">would a ‘return;’ instead of ‘return(-1);’ suffice>?<div><br><div>
<div>Mark Brethen</div><div><a href="mailto:mark.brethen@gmail.com" target="_blank">mark.brethen@gmail.com</a></div>

</div>
<div><br><blockquote type="cite"><div>On Jul 26, 2022, at 11:51 AM, Christopher Jones <<a href="mailto:jonesc@hep.phy.cam.ac.uk" target="_blank">jonesc@hep.phy.cam.ac.uk</a>> wrote:</div><div><div style="word-wrap:break-word;line-break:after-white-space"><div><br></div>clang is correct in this case, gcc is being sloppy. <div><br></div><div>Basically you cannot return a value, from a function declared as void… fairly basic stuff really..<br><div><br><blockquote type="cite"><div>On 26 Jul 2022, at 5:34 pm, Mark Brethen <<a href="mailto:mark.brethen@gmail.com" target="_blank">mark.brethen@gmail.com</a>> wrote:</div><br><div><div style="word-wrap:break-word;line-break:after-white-space"><div>I’m seeing this build error when using clang (gcc doesn’t complain):</div><div><br></div><div><div>info:build /opt/local/bin/clang-mp-14 -O2 -Wall -Wno-narrowing -I./ -I/opt/local/include -I/opt/local/include/GL -I../../libSNL/src -I../../glut-3.5/src    -c -o pickFunktions.o pickFunktions.c</div><div>:info:build pickFunktions.c:4599:7: error: void function 'moveLineEndPoint' should not return a value [-Wreturn-type]</div><div>:info:build       return(-1);</div><div>:info:build       ^     ~~~~</div></div><div><br></div><div>code snippet below:</div><div><br></div><div> <span style="font-family:Menlo;font-size:11px">void moveLineEndPoint(int lineNr, int pntNr, double llength)</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">{</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  int p1,p2, flag=0;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  double P1[3], P2[3], u, eva[3], va[3], p0p1_2[3];</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    p1=line[lineNr].p1;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    p2=line[lineNr].p2;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    /* determine which side of the line has to be moved */</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    if(pntNr==p1) flag=-1;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    else if(pntNr==p2) flag=1;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    else</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    {</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      printf("ERROR: selected point:%s is no line endpoint\n", point[pntNr].name);</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      return(-1);</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    }</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    u=flag*llength;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    u/=scale->w;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    /* calc direction */</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    if(line[lineNr].typ=='s')</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    {</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      if(flag==-1) p2=set[line[lineNr].trk].pnt[1];</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      else  p1=set[line[lineNr].trk].pnt[set[line[lineNr].trk].anz_p-2];</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    }</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    P1[0]=point[p1].px;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    P1[1]=point[p1].py;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    P1[2]=point[p1].pz;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    P2[0]=point[p2].px;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    P2[1]=point[p2].py;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    P2[2]=point[p2].pz;</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    v_result( P1, P2, p0p1_2);</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    v_norm(p0p1_2,eva);</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    v_scal(&u,eva, va);</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    point[pntNr].px+=va[0];</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    point[pntNr].py+=va[1];</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    point[pntNr].pz+=va[2];</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    printf("moved by dxyz= %lf %lf %lf\n",</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      (va[0]* scale->w),</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      (va[1]* scale->w),</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      (va[2]* scale->w));</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div>I do not code in C, so I’ll pass this up to the developer. How should this be patched?</div><br><div>
<div>Thanks,</div><div>Mark</div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></blockquote></div></div>