Skip to content

Multiple warnings issued by g++ and clang++ compilers #11

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. compile with -ansi -pedantic -Wall using clang++ 
2. compile with -ansi -pedantic -Wall using g++ 
3.

What is the expected output? What do you see instead?

Expected output is to have no warnings or errors. Instead, I see:

$ clang++ -ansi -pedantic -Wall example.cc
In file included from example.cc:10:
./gnuplot_i.hpp:259:64: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_smooth(){ smooth = ""; return *this;}; 
                                                               ^
./gnuplot_i.hpp:266:63: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& set_grid()  {cmd("set grid");return *this;};
                                                               ^
./gnuplot_i.hpp:268:66: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_grid(){cmd("unset grid");return *this;}; 
                                                                 ^
./gnuplot_i.hpp:277:73: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& set_multiplot(){cmd("set multiplot") ;return *this;};
                                                                        ^
./gnuplot_i.hpp:286:76: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_multiplot(){cmd("unset multiplot");return *this;};
                                                                           ^
./gnuplot_i.hpp:302:63: warning: extra ';' inside a class [-pedantic]
    Gnuplot& set_hidden3d(){cmd("set hidden3d");return *this;};
                                                              ^
./gnuplot_i.hpp:311:75: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_hidden3d(){cmd("unset hidden3d"); return *this;}; 
                                                                          ^
./gnuplot_i.hpp:323:72: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_contour(){cmd("unset contour");return *this;};
                                                                       ^
./gnuplot_i.hpp:332:68: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& set_surface(){cmd("set surface");return *this;}; 
                                                                   ^
./gnuplot_i.hpp:409:101: warning: extra ';' inside a class [-pedantic]
  ...xrange restore");cmd("set autoscale x");return *this;};
                                                           ^
./gnuplot_i.hpp:418:101: warning: extra ';' inside a class [-pedantic]
  ...yrange restore");cmd("set autoscale y");return *this;};
                                                           ^
./gnuplot_i.hpp:427:101: warning: extra ';' inside a class [-pedantic]
  ...zrange restore");cmd("set autoscale z");return *this;};
                                                           ^
./gnuplot_i.hpp:444:78: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_xlogscale(){cmd("unset logscale x"); return *this;};
                                                                             ^
./gnuplot_i.hpp:453:78: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_ylogscale(){cmd("unset logscale y"); return *this;};
                                                                             ^
./gnuplot_i.hpp:462:78: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& unset_zlogscale(){cmd("unset logscale z"); return *this;};
                                                                             ^
./gnuplot_i.hpp:563:78: warning: extra ';' inside a class [-pedantic]
    inline Gnuplot& replot(void){if (nplots > 0) cmd("replot");return *this;};
                                                                             ^
./gnuplot_i.hpp:582:43: warning: extra ';' inside a class [-pedantic]
    inline bool is_valid(){return(valid);};
                                          ^
./gnuplot_i.hpp:1874:1: warning: control may reach end of non-void function
      [-Wreturn-type]
}
^
18 warnings generated.

g++ also generates warnings, but not as many:

$ g++ -ansi -pedantic -Wall example.cc
In file included from example.cc:10:
gnuplot_i.hpp: In member function ‘Gnuplot& Gnuplot::plot_image(const 
unsigned char*, unsigned int, unsigned int, const std::string&)’:
gnuplot_i.hpp:1600: warning: comparison between signed and unsigned integer 
expressions
gnuplot_i.hpp:1602: warning: comparison between signed and unsigned integer 
expressions
gnuplot_i.hpp: In member function ‘bool Gnuplot::file_available(const 
std::string&)’:
gnuplot_i.hpp:1874: warning: control reaches end of non-void function
[kmess@bellagio gnuplot-cpp]$

What version of the product are you using? On what operating system?
version 3, dated 10/03/08

$ uname -a
Linux bellagio 2.6.32-358.6.2.el6.centos.plus.i686 #1 SMP Thu May 16 17:02:17 
UTC 2013 i686 i686 i386 GNU/Linux
$ g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang++ --version
clang version 2.8 (branches/release_28)
Target: i386-redhat-linux-gnu
Thread model: posix



Please provide any additional information below.

Original issue reported on code.google.com by kevin.m...@gmail.com on 30 May 2013 at 6:25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions