public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* Can I use SN to ask questions about C++?
@ 2000-09-24 12:19 Mark Stankus
  2000-09-24 12:41 ` Ian Roxborough
  2000-09-27 21:38 ` Ben Elliston
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Stankus @ 2000-09-24 12:19 UTC (permalink / raw)
  To: sourcenav

 
Dear Source Navigator Developer(s),
 
  I love Source Navigator(SN).
 
  I was wondering if there is an API for SN so that I could write small
programs
(or write data base queries) to ask questions about the C++ code which
has been "SN-ed".
The goal is to look for inefficiencies in C++ code and improve
maintainability of C++
via computer programs.  The questions below are samples (requiring some
SQL would be
fine or, even better, a C++ interface).
 
(Note, if any of the following questions can be answered by an existing
tool,
I would like to know.)
 
Thanks,
Mark Stankus
mstankus@calpoly.edu
 
1) Determine all class names which have a default constructor generated
by the compiler.
2) Determine all class names which have a default constructor generated
by the compiler
   and it is used.
3) Determine all class names which have a copy constructor generated by
the compiler.
4) Determine all class names which have a copy constructor generated by
the compiler
   and it is used.
5) Find all class names which use the macro
USE_GENERATED_DEFAULT_CONSTRUCTOR
6) Find all class names which use the macro
   USE_GENERATED_DEFAULT_CONSTRUCTOR, and define a default constructor.
   ( This would be some "AND" in terms of data base queries or a list
intersection
     for a C++ interface. )
   (BY THE WAY, I would like to start putting EITHER
USE_GENERATED_DEFAULT_CONSTRUCTOR or X()
    but not both in every class X which I write so that my intentions
are clear.)
7) Find all instances of 'bool operator==(unsigned int,int)' in the
code.
   (For example,  int main() {
                    unsigned int a,b;
                    int c;
                    bool d = a==b;
                    bool e = a==c;
                    bool f = 0==1L;
                    bool g = 0U==1;
                    return 0;
                  }
                  would indicate the 'e' and 'g' lines.)         
 
8) Determine all locations where adding the keyword 'explicit' to a
   constructor, say 'X(const Y &)', will create a compiler error.
   (See http://www.calpoly.edu/~mstankus/mozilla )
9) Find all locations where adding the keyword 'explicit' to the code
   wherever appropriate would generate compiler errors.
   (See http://www.calpoly.edu/~mstankus/mozilla )
10) Determine when temporaries are created.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-09-27 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-24 12:19 Can I use SN to ask questions about C++? Mark Stankus
2000-09-24 12:41 ` Ian Roxborough
2000-09-27 21:38   ` Ben Elliston
2000-09-27 21:38 ` Ben Elliston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).