comp.lang.ada
 help / color / mirror / Atom feed
* Is the Ada compiler of Polyspace invalid?
@ 2011-02-18  8:58 Julian Leyh
  2011-02-18  9:40 ` Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Julian Leyh @ 2011-02-18  8:58 UTC (permalink / raw)


Hi,

I have some Ada code, which I would like to try Polyspace on.

It contains something like this (simplified):

foo.ads:
procedure foo;

foo.adb:
procedure foo is
...
end foo;

somewhere else:
with foo;
...
foo;
...

The Polyspace compiler doesn't seem to like this..

In my understanding, the above should be completely valid Ada code -
even should have been valid Ada83 code (I use Ada95 standard for my
project).

Is the Polyspace compiler wrong? That would mean, it is no valid Ada
compiler.. Or is there a way to make Polyspace understand it?

Greetings,
Julian



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18  8:58 Is the Ada compiler of Polyspace invalid? Julian Leyh
@ 2011-02-18  9:40 ` Martin
  2011-02-21  8:32   ` Julian Leyh
  2011-02-18 16:27 ` Paul Colin Gloster
  2011-02-18 16:50 ` Adam Beneschan
  2 siblings, 1 reply; 10+ messages in thread
From: Martin @ 2011-02-18  9:40 UTC (permalink / raw)


On Feb 18, 8:58 am, Julian Leyh <jul...@vgai.de> wrote:
> Hi,
>
> I have some Ada code, which I would like to try Polyspace on.
>
> It contains something like this (simplified):
>
> foo.ads:
> procedure foo;
>
> foo.adb:
> procedure foo is
> ...
> end foo;
>
> somewhere else:
> with foo;
> ...
> foo;
> ...
>
> The Polyspace compiler doesn't seem to like this..
>
> In my understanding, the above should be completely valid Ada code -
> even should have been valid Ada83 code (I use Ada95 standard for my
> project).
>
> Is the Polyspace compiler wrong? That would mean, it is no valid Ada
> compiler.. Or is there a way to make Polyspace understand it?
>
> Greetings,
> Julian

What's the error you're seeing? also what folders/files are visible in
your polyspace project?...

-- Martin



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18  8:58 Is the Ada compiler of Polyspace invalid? Julian Leyh
  2011-02-18  9:40 ` Martin
@ 2011-02-18 16:27 ` Paul Colin Gloster
  2011-02-18 16:42   ` Simon Wright
                     ` (2 more replies)
  2011-02-18 16:50 ` Adam Beneschan
  2 siblings, 3 replies; 10+ messages in thread
From: Paul Colin Gloster @ 2011-02-18 16:27 UTC (permalink / raw)


Julian Leyh <julian@VGAI.De> sent on February 18th, 2011:
|-------------------------------------------------------------|
|"Hi,                                                         |
|                                                             |
|I have some Ada code, which I would like to try Polyspace on.|
|                                                             |
|It contains something like this (simplified):                |
|                                                             |
|foo.ads:                                                     |
|procedure foo;                                               |
|                                                             |
|foo.adb:                                                     |
|procedure foo is                                             |
|...                                                          |
|end foo;                                                     |
|                                                             |
|somewhere else:                                              |
|with foo;"                                                   |
|-------------------------------------------------------------|

Hi,

Do you really have something like that? You cannot WITH a procedure.

|-------------------------------------------------------------|
|"[..]                                                        |
|                                                             |
|The Polyspace compiler doesn't seem to like this..           |
|                                                             |
|[..]"                                                        |
|-------------------------------------------------------------|

The code checkers from Polyspace are not compilers.

Yours sincerely,
Paul Colin Gloster



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18 16:27 ` Paul Colin Gloster
@ 2011-02-18 16:42   ` Simon Wright
  2011-02-18 18:04     ` Paul Colin Gloster
  2011-02-18 16:43   ` Adam Beneschan
  2011-02-18 17:08   ` Martin
  2 siblings, 1 reply; 10+ messages in thread
From: Simon Wright @ 2011-02-18 16:42 UTC (permalink / raw)


Paul Colin Gloster <Colin_Paul_Gloster@ACM.org> writes:

> Julian Leyh <julian@VGAI.De> sent on February 18th, 2011:
> |-------------------------------------------------------------|
> |"Hi,                                                         |
> |                                                             |
> |I have some Ada code, which I would like to try Polyspace on.|
> |                                                             |
> |It contains something like this (simplified):                |
> |                                                             |
> |foo.ads:                                                     |
> |procedure foo;                                               |
> |                                                             |
> |foo.adb:                                                     |
> |procedure foo is                                             |
> |...                                                          |
> |end foo;                                                     |
> |                                                             |
> |somewhere else:                                              |
> |with foo;"                                                   |
> |-------------------------------------------------------------|
>
> Hi,
>
> Do you really have something like that? You cannot WITH a procedure.

Yes you can.

ARM 10.1.1(6)
[http://www.adaic.org/resources/add_content/standards/05rm/html/RM-10-1-1.html]
includes subprogram_declaration in library_declaration.

I assure you that this works!



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18 16:27 ` Paul Colin Gloster
  2011-02-18 16:42   ` Simon Wright
@ 2011-02-18 16:43   ` Adam Beneschan
  2011-02-18 17:08   ` Martin
  2 siblings, 0 replies; 10+ messages in thread
From: Adam Beneschan @ 2011-02-18 16:43 UTC (permalink / raw)


On Feb 18, 8:27 am, Paul Colin Gloster <Colin_Paul_Glos...@ACM.org>
wrote:
> Julian Leyh <jul...@VGAI.De> sent on February 18th, 2011:
> |-------------------------------------------------------------|
> |"Hi,                                                         |
> |                                                             |
> |I have some Ada code, which I would like to try Polyspace on.|
> |                                                             |
> |It contains something like this (simplified):                |
> |                                                             |
> |foo.ads:                                                     |
> |procedure foo;                                               |
> |                                                             |
> |foo.adb:                                                     |
> |procedure foo is                                             |
> |...                                                          |
> |end foo;                                                     |
> |                                                             |
> |somewhere else:                                              |
> |with foo;"                                                   |
> |-------------------------------------------------------------|
>
> Hi,
>
> Do you really have something like that? You cannot WITH a procedure.

Yes, you can, if it's a library unit.

                       -- Adam


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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18  8:58 Is the Ada compiler of Polyspace invalid? Julian Leyh
  2011-02-18  9:40 ` Martin
  2011-02-18 16:27 ` Paul Colin Gloster
@ 2011-02-18 16:50 ` Adam Beneschan
  2 siblings, 0 replies; 10+ messages in thread
From: Adam Beneschan @ 2011-02-18 16:50 UTC (permalink / raw)


On Feb 18, 12:58 am, Julian Leyh <jul...@vgai.de> wrote:
> Hi,
>
> I have some Ada code, which I would like to try Polyspace on.
>
> It contains something like this (simplified):
>
> foo.ads:
> procedure foo;
>
> foo.adb:
> procedure foo is
> ...
> end foo;
>
> somewhere else:
> with foo;
> ...
> foo;
> ...
>
> The Polyspace compiler doesn't seem to like this..

I don't know anything about Polyspace.  But a couple things come to
mind:

(a) In order to say "with foo;", foo has to be a library unit, and it
has to be in the library.  The language does not define what the
"library" is or how units get entered into it.  How this happens
varies between compiler vendors.  I believe that with GNAT, the mere
presence of foo.ads would be enough to tell the compiler that the unit
"foo" is in the library.  With other compilers, though, you have to
take other steps (such as running a command that compiles foo.ads).
You'll have to check the documentation.

(b) Even if "foo" is in the library, there may be another identifier
named "foo" that is visible at the point where you call it, which can
lead to the library unit being hidden or to the call being ambiguous.
You'd need to tell us just what errors you're getting for the rest of
us to help with this.

                                 -- Adam



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18 16:27 ` Paul Colin Gloster
  2011-02-18 16:42   ` Simon Wright
  2011-02-18 16:43   ` Adam Beneschan
@ 2011-02-18 17:08   ` Martin
  2 siblings, 0 replies; 10+ messages in thread
From: Martin @ 2011-02-18 17:08 UTC (permalink / raw)


On Feb 18, 4:27 pm, Paul Colin Gloster <Colin_Paul_Glos...@ACM.org>
wrote:
> The code checkers from Polyspace are not compilers.


But they do contain the front-end of a compiler for the language they
support. For one, they need to translate the code into their own
internal representation.

-- Martin
Polyspace user for many-a-year



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18 16:42   ` Simon Wright
@ 2011-02-18 18:04     ` Paul Colin Gloster
  0 siblings, 0 replies; 10+ messages in thread
From: Paul Colin Gloster @ 2011-02-18 18:04 UTC (permalink / raw)


Simon Wright <simon@pushface.org> sent on February 18th, 2011:
|----------------------------------------------------------------------|
|"Paul Colin Gloster <Colin_Paul_Gloster@ACM.org> writes:              |
|                                                                      |
|[..]                                                                  |
|> Do you really have something like that? You cannot WITH a procedure.|
|                                                                      |
|Yes you can.                                                          |
|                                                                      |
|[..]"                                                                 |
|----------------------------------------------------------------------|

I was mistaken. Sorry.



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-18  9:40 ` Martin
@ 2011-02-21  8:32   ` Julian Leyh
  2011-02-21 15:54     ` Adam Beneschan
  0 siblings, 1 reply; 10+ messages in thread
From: Julian Leyh @ 2011-02-21  8:32 UTC (permalink / raw)


On 18 Feb., 10:40, Martin <martin.do...@btopenworld.com> wrote:
> On Feb 18, 8:58 am, Julian Leyh <jul...@vgai.de> wrote:
>
>
>
> > Hi,
>
> > I have some Ada code, which I would like to try Polyspace on.
>
> > It contains something like this (simplified):
>
> > foo.ads:
> > procedure foo;
>
> > foo.adb:
> > procedure foo is
> > ...
> > end foo;
>
> > somewhere else:
> > with foo;
> > ...
> > foo;
> > ...
>
> > The Polyspace compiler doesn't seem to like this..
>
> > In my understanding, the above should be completely valid Ada code -
> > even should have been valid Ada83 code (I use Ada95 standard for my
> > project).
>
> > Is the Polyspace compiler wrong? That would mean, it is no valid Ada
> > compiler.. Or is there a way to make Polyspace understand it?
>
> > Greetings,
> > Julian
>
> What's the error you're seeing? also what folders/files are visible in
> your polyspace project?...
>
> -- Martin

The error is:

Error: procedure or entry name expected.



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

* Re: Is the Ada compiler of Polyspace invalid?
  2011-02-21  8:32   ` Julian Leyh
@ 2011-02-21 15:54     ` Adam Beneschan
  0 siblings, 0 replies; 10+ messages in thread
From: Adam Beneschan @ 2011-02-21 15:54 UTC (permalink / raw)


On Feb 21, 12:32 am, Julian Leyh <jul...@vgai.de> wrote:
> On 18 Feb., 10:40, Martin <martin.do...@btopenworld.com> wrote:
>
>
>
>
>
> > On Feb 18, 8:58 am, Julian Leyh <jul...@vgai.de> wrote:
>
> > > Hi,
>
> > > I have some Ada code, which I would like to try Polyspace on.
>
> > > It contains something like this (simplified):
>
> > > foo.ads:
> > > procedure foo;
>
> > > foo.adb:
> > > procedure foo is
> > > ...
> > > end foo;
>
> > > somewhere else:
> > > with foo;
> > > ...
> > > foo;
> > > ...
>
> > > The Polyspace compiler doesn't seem to like this..
>
> > > In my understanding, the above should be completely valid Ada code -
> > > even should have been valid Ada83 code (I use Ada95 standard for my
> > > project).
>
> > > Is the Polyspace compiler wrong? That would mean, it is no valid Ada
> > > compiler.. Or is there a way to make Polyspace understand it?
>
> > > Greetings,
> > > Julian
>
> > What's the error you're seeing? also what folders/files are visible in
> > your polyspace project?...
>
> > -- Martin
>
> The error is:
>
> Error: procedure or entry name expected.- Hide quoted text -

Are there other uses of the identifier "foo"?  Other uses that could
cause problems are "foo" being declared as something else or used as a
statement label or block or loop identifier in the same unit that's
calling foo.  If the unit is a package body, then a "foo" defined in
the specification could also cause problems.  Also, if the unit is a
child unit, a "foo" defined in the specification of the parent package
or any ancestor package can cause problems.  Finally, a "foo" defined
in the specification of any USE'd package can cause problems.
Depending on the circumstances, any of these could lead to a situation
where the library unit "foo" that got WITH'ed is hidden.

If the identifier really did get hidden, you can still call it by
referring to it as "standard.foo;"

                                 -- Adam




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

end of thread, other threads:[~2011-02-21 15:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-18  8:58 Is the Ada compiler of Polyspace invalid? Julian Leyh
2011-02-18  9:40 ` Martin
2011-02-21  8:32   ` Julian Leyh
2011-02-21 15:54     ` Adam Beneschan
2011-02-18 16:27 ` Paul Colin Gloster
2011-02-18 16:42   ` Simon Wright
2011-02-18 18:04     ` Paul Colin Gloster
2011-02-18 16:43   ` Adam Beneschan
2011-02-18 17:08   ` Martin
2011-02-18 16:50 ` Adam Beneschan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox