[PATCH xts] xts5: Fix clang error - non-void function 'tet_main' should return a value

Peter Hutterer peter.hutterer at who-t.net
Mon Jan 9 00:53:11 UTC 2017


On Sun, Jan 08, 2017 at 01:54:05PM -0500, Rhys Kidd wrote:
> On 27 December 2016 at 20:45, Rhys Kidd <rhyskidd at gmail.com> wrote:
> 
> > Amongst examples:
> >
> > XDisplayString/Test1.c:151:3: error: non-void function 'tet_main' should
> > return
> >       a value [-Wreturn-type]
> >                 return;
> >                 ^
> >
> > Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
> >
> 
> Gentle ping.

pushed, thanks.

   6f2e907..ea595bb  master -> master

fwiw, still complains XDisplayName/Test1.c:181:1: warning: control reaches
end of non-void function [-Wreturn-type]
but that's not caused by or related to this patch.

Cheers,
   Peter

>
> > ---
> >  xts5/Xlib12/XDisplayName/Test1.c     | 3 ++-
> >  xts5/Xlib15/XSetWMProperties/Test1.c | 6 ++++--
> >  xts5/Xlib15/XSetWMProperties/Test2.c | 6 ++++--
> >  xts5/Xlib17/XGetDefault/Test3.c      | 3 ++-
> >  xts5/Xlib17/XGetDefault/Test4.c      | 3 ++-
> >  xts5/Xlib17/XGetDefault/Test5.c      | 6 ++++--
> >  xts5/Xlib3/XDisplayString/Test1.c    | 8 +++++---
> >  xts5/Xlib3/XOpenDisplay/Test1.c      | 6 ++++--
> >  8 files changed, 27 insertions(+), 14 deletions(-)
> >
> > diff --git a/xts5/Xlib12/XDisplayName/Test1.c b/xts5/Xlib12/XDisplayName/
> > Test1.c
> > index a1bb851..e54d926 100644
> > --- a/xts5/Xlib12/XDisplayName/Test1.c
> > +++ b/xts5/Xlib12/XDisplayName/Test1.c
> > @@ -156,7 +156,8 @@ char                *str;
> >
> >         if((dispstr = getenv("DISPLAY")) == NULL) {
> >                 delete("Environment variable DISPLAY is not set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > diff --git a/xts5/Xlib15/XSetWMProperties/Test1.c b/xts5/Xlib15/
> > XSetWMProperties/Test1.c
> > index 7c2cf28..6825f2c 100644
> > --- a/xts5/Xlib15/XSetWMProperties/Test1.c
> > +++ b/xts5/Xlib15/XSetWMProperties/Test1.c
> > @@ -156,7 +156,8 @@ XClassHint  rclass_hints;
> >
> >         if( (res_name = getenv("RESOURCE_NAME")) == NULL) {
> >                 delete("RESOURCE_NAME environment variable is not set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > @@ -172,7 +173,8 @@ XClassHint  rclass_hints;
> >
> >         if( XGetClassHint(Dsp, win, &rclass_hints) == 0 ) {
> >                 delete("XGetClassHints returned zero.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > diff --git a/xts5/Xlib15/XSetWMProperties/Test2.c b/xts5/Xlib15/
> > XSetWMProperties/Test2.c
> > index d52cef3..f94f239 100644
> > --- a/xts5/Xlib15/XSetWMProperties/Test2.c
> > +++ b/xts5/Xlib15/XSetWMProperties/Test2.c
> > @@ -156,7 +156,8 @@ XClassHint  rclass_hints;
> >
> >         if( getenv("RESOURCE_NAME") != (char *)NULL) {
> >                 delete("RESOURCE_NAME environment variable was set to
> > \"%s\" instead of being undefined.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > @@ -172,7 +173,8 @@ XClassHint  rclass_hints;
> >
> >         if( XGetClassHint(Dsp, win, &rclass_hints) == 0 ) {
> >                 delete("XGetClassHints returned zero.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > diff --git a/xts5/Xlib17/XGetDefault/Test3.c b/xts5/Xlib17/XGetDefault/
> > Test3.c
> > index 05ba128..14542b6 100644
> > --- a/xts5/Xlib17/XGetDefault/Test3.c
> > +++ b/xts5/Xlib17/XGetDefault/Test3.c
> > @@ -151,7 +151,8 @@ char                *pval="XTest.testval31:pval_a\
> > nXTest.testval32:pval_b\nXTest.testval33:pva
> >
> >         if(getenv("HOME") == NULL) {
> >                 delete("Environment variable \"HOME\" is not set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > diff --git a/xts5/Xlib17/XGetDefault/Test4.c b/xts5/Xlib17/XGetDefault/
> > Test4.c
> > index 958fa91..5c53dd7 100644
> > --- a/xts5/Xlib17/XGetDefault/Test4.c
> > +++ b/xts5/Xlib17/XGetDefault/Test4.c
> > @@ -154,7 +154,8 @@ static      char    *result[]  = { "pVAL_1",
> > "eVAL_5",    "eVAL_6" };
> >
> >         if(getenv("XENVIRONMENT") == NULL) {
> >                 delete("XENVIRONMENT environment variable not set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > diff --git a/xts5/Xlib17/XGetDefault/Test5.c b/xts5/Xlib17/XGetDefault/
> > Test5.c
> > index 628ba7d..5e506ae 100644
> > --- a/xts5/Xlib17/XGetDefault/Test5.c
> > +++ b/xts5/Xlib17/XGetDefault/Test5.c
> > @@ -157,13 +157,15 @@ static    char    *result[]  = { "pVAL_1",
> > "hVAL_5",    "hVAL_6" , "hVAL_7"};
> >
> >         if(getenv("XENVIRONMENT") != NULL) {
> >                 delete("XENVIRONMENT environment variable was set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> >         if(getenv("HOME") == NULL) {
> >                 delete("HOME environment variable was not set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > diff --git a/xts5/Xlib3/XDisplayString/Test1.c
> > b/xts5/Xlib3/XDisplayString/Test1.c
> > index 119d790..d6bce99 100644
> > --- a/xts5/Xlib3/XDisplayString/Test1.c
> > +++ b/xts5/Xlib3/XDisplayString/Test1.c
> > @@ -148,13 +148,15 @@ Display           *display;
> >
> >         if((dispstr = getenv("DISPLAY")) == NULL) {
> >                 delete("Environment variable DISPLAY is not set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> >         if((display = XOpenDisplay("")) == (Display *) NULL) {
> > -               delete("XOpenDisplay() returned NULL.");
> > -               return;
> > +               delete("XOpenDisplay() returned NULL.");
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > diff --git a/xts5/Xlib3/XOpenDisplay/Test1.c b/xts5/Xlib3/XOpenDisplay/
> > Test1.c
> > index e083865..3453b93 100644
> > --- a/xts5/Xlib3/XOpenDisplay/Test1.c
> > +++ b/xts5/Xlib3/XOpenDisplay/Test1.c
> > @@ -149,7 +149,8 @@ Display             *display;
> >
> >         if((dispstr = getenv("DISPLAY")) == NULL) {
> >                 delete("Environment variable DISPLAY is not set.");
> > -               return;
> > +               UNRESOLVED;
> > +               return(False);
> >         } else
> >                 CHECK;
> >
> > @@ -163,7 +164,8 @@ Display             *display;
> >
> >                 if(rdispstr == (char *) NULL) {
> >                         delete("%s() returned NULL.", TestName);
> > -                       return;
> > +                       UNRESOLVED;
> > +                       return(False);
> >                 } else {
> >                         CHECK;
> >                         if(strcmp(rdispstr, dispstr) != 0) {
> > --
> > 2.9.3
> >
> >

> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel



More information about the xorg-devel mailing list