Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Chastain <mec.gnu@mindspring.com>
To: gdb-patches@sources.redhat.com, baurzhan.ismagulov@sbs.com.tr
Subject: Re: testcase for "absolute source" patch
Date: Wed, 18 Aug 2004 15:31:00 -0000	[thread overview]
Message-ID: <4123763C.nailM3P11DT7E@mindspring.com> (raw)
In-Reply-To: <20040818130626.GB1411@ata.cs.hun.edu.tr>

Hi Baurzhan,

bi> 1. Just for my knowledge: I've found the "int main" requirement in C99
bi>    5.1.2.2.1. But I couldn't find anything about function definitions
bi>    without a return type defaulting to int (i.e., should the compiler
bi>    treat the return type as int if it isn't specified?). Does C99 and
bi>    previous standards say anything about that? Is it different for
bi>    declarations and definitions?

I don't have copies of the standards documents, so I'm working from
The C++ Programming Language 2nd Edition, Kernighan and Ritchie.
To my surprise, I found out that in this book, and presumably in
the C89 standard, a function with no return type defaults to "int".
From section 1.9:

  "This line also declares that getline returns an int;
   since int is the default return type, it could be omitted."

I don't think it's different for declarations and definitions.

In a normal program, the FSF coding standards would apply.  But a test
suite is contra-variant.  Anything that is legal C89 and that doesn't
make gcc give a warning is okay in a test program, and variation is good
because it exercises different parts of gdb.

So it's okay to leave your "main" with no return type.
But take out the "-w" from gdb_compile.

bi> 2. As far as I could see, remote_exec host starts a new shell each time.
bi>    How should one do the following right?
bi>
bi>    remote_exec host cd ...
bi>    remote_exec host gdb_compile ...
bi>    remote_exec host cd ...
bi>
bi>    I'm reluctant to write scripts since I have to do the same with
bi>    gdb_test, too.

I don't know.

Dejagnu's desire to manage the filenames on the host machine conflicts
with your desire for explicit control of the filenames.

Normally you would call gdb_compile (not remote_exec host gdb_compile).
gdb_compile calls target_compile, which calls default_target_compile,
which calls remote_exec, which calls call_remote.  You would need a
hook inside call_remote to send several commands to the same shell.
Ick!

Alternatively, you would need to forsake gdb_compile and do everything
at the "remote_exec host cd ... && gcc ... && cd ...", basically
duplicating the machinery inside default_target_compile to process
the options (but you know what your own options are) and to find the
name of the c compiler.

I have another issue which demands that I clean up the machinery
that locates compilers.  The issue is how to run the test suite
with non-fsf compilers, especially for fortran.

Let me think about this, and I will get back to tonight or tomorrow,
also with detailed feedback on your version #2.

Michael


  reply	other threads:[~2004-08-18 15:31 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-16 14:41 Baurzhan Ismagulov
2004-08-16 15:56 ` Michael Chastain
2004-08-16 18:21   ` Baurjan Ismagulov
2004-08-16 19:15 ` Michael Chastain
2004-08-16 20:38   ` Andreas Schwab
2004-08-18 13:03   ` Baurzhan Ismagulov
2004-08-18 15:31     ` Michael Chastain [this message]
2004-08-18 15:50       ` Daniel Jacobowitz
2004-08-18 15:56         ` Baurjan Ismagulov
2004-08-18 16:04           ` Andreas Schwab
2004-08-18 15:50       ` Baurzhan Ismagulov
2004-08-18 17:10         ` Michael Chastain
2004-08-18 19:00         ` Michael Chastain
2004-08-18 22:03           ` Baurjan Ismagulov
2004-08-18 22:46             ` Michael Chastain
2004-08-18 23:33             ` Michael Chastain
2004-08-19  4:03               ` Eli Zaretskii
2004-08-19  8:34                 ` Michael Chastain
2004-08-19  8:56               ` Michael Chastain
2004-08-19  9:37                 ` Baurjan Ismagulov
2004-08-19  9:34               ` Baurjan Ismagulov
2004-08-19  9:55                 ` Michael Chastain
2004-08-19 10:10                   ` Baurjan Ismagulov
2004-08-19 10:20                     ` Michael Chastain
2004-08-26 20:36                   ` Baurjan Ismagulov
2004-08-26 20:52                     ` Michael Chastain
2004-08-26 20:32               ` Baurjan Ismagulov
2004-08-27 14:16                 ` Michael Chastain
2004-08-27 16:45                   ` Baurjan Ismagulov
2004-08-29 11:56                     ` Michael Chastain
2004-08-31 15:01                     ` Michael Chastain
2004-09-25 21:12                       ` Baurjan Ismagulov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4123763C.nailM3P11DT7E@mindspring.com \
    --to=mec.gnu@mindspring.com \
    --cc=baurzhan.ismagulov@sbs.com.tr \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox