From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.99.9 with SMTP id x9mr3232104ywb.151.1479319295230; Wed, 16 Nov 2016 10:01:35 -0800 (PST) X-Received: by 10.157.39.129 with SMTP id c1mr2713269otb.15.1479319295137; Wed, 16 Nov 2016 10:01:35 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!n6no163375qtd.0!news-out.google.com!c26ni834itd.0!nntp.google.com!w132no248436ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 16 Nov 2016 10:01:34 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:c7d:3cda:7600:932b:b705:6315:5a80; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS NNTP-Posting-Host: 2a02:c7d:3cda:7600:932b:b705:6315:5a80 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <04081823-0013-4bc4-b461-ba9c1a5e40b3@googlegroups.com> Subject: s-stoele.ads:62:69: error: cannot convert to a pointer type From: Lucretia Injection-Date: Wed, 16 Nov 2016 18:01:35 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:32347 Date: 2016-11-16T10:01:34-08:00 List-Id: Hi, I've been updating my bare_bones project and I've always wanted to add a simple secondary stack to it, so as a dummy interface I created the following in my RTS: package System.Secondary_Stack is package SSE renames System.Storage_Elements; type Mark_Id is private; function SS_Mark return Mark_Id; procedure SS_Allocate (Addr : System.Address; Storage_Size : SSE.Storage_Count); procedure SS_Release (M : Mark_Id); private type Mark_Id is new SSE.Integer_Address; SS_Pool : Integer; SS_Size : constant SSE.Storage_Element with import => True, Convention => Asm, External_Name => "sec_stack_size"; end System.Secondary_Stack; package body System.Secondary_Stack is function SS_Mark return Mark_Id is begin return Mark_Id'First; end SS_Mark; procedure SS_Allocate (Addr : System.Address; Storage_Size : SSE.Storage_Count) is begin null; end SS_Allocate; procedure SS_Release (M : Mark_Id) is begin null; end SS_Release; end System.Secondary_Stack; But when compiling this: -- Cut out the use/with clauses procedure Bare_Bones is Line : Screen_Height_Range := Screen_Height_Range'First; procedure T is begin Put ("T called", Screen_Width_Range'First, Line); end T; function Hello return String is begin return "hello"; end Hello; begin -- null; Clear; Put ("Hello, bare bones in Ada", Screen_Width_Range'First, Line); Line := Line + 1; if Magic = Magic_Value then Put ("Magic numbers match!", Screen_Width_Range'First, Line); else Put ("Magic numbers don't match!", Screen_Width_Range'First, Line); -- comment raise Program_Error; end if; Line := Line + 1; T; Line := Line + 1; Put (Hello, Screen_Width_Range'First, Line); end Bare_Bones; I get the following error: GNAT 4.9.2 Copyright 1992-2014, Free Software Foundation, Inc. /home/laguest/src/mine/bare_bones/build/gnat/gen/rts/i586/adainclude/s-stoele.ads: In function 'Bare_Bones.Hello': /home/laguest/src/mine/bare_bones/build/gnat/gen/rts/i586/adainclude/s-stoele.ads:62:69: error: cannot convert to a pointer type Compiling: /home/laguest/src/mine/bare_bones/src/bare_bones.adb (source file time stamp: 2016-11-16 17:01:32) 186 lines: No errors End of compilation i586-elf-gnatmake: "/home/laguest/src/mine/bare_bones/src/bare_bones.adb" compilation error makefile:118: recipe for target '/home/laguest/src/mine/bare_bones/build/gnat/gen/pc/debug/disk/boot/bare_bones-i586.elf' failed make: *** [/home/laguest/src/mine/bare_bones/build/gnat/gen/pc/debug/disk/boot/bare_bones-i586.elf] Error 4 My expanded source is: pragma restrictions (no_obsolescent_features); with vga_console; use vga_console; with multiboot; use multiboot; use type multiboot.multiboot__magic_values; with system.system__secondary_stack; procedure bare_bones is M9b : system__secondary_stack__mark_id := $system__secondary_stack__ss_mark; procedure bare_bones___finalizer; freeze bare_bones___finalizer [] procedure bare_bones___finalizer is begin $system__secondary_stack__ss_release (M9b); return; end bare_bones___finalizer; begin line : vga_console__screen_height_range := 1; procedure bare_bones__t is begin vga_console__put__2 ("T called", 1, line, foreground => vga_console__white, background => vga_console__black); return; end bare_bones__t; function bare_bones__hello return string is begin return "hello"; end bare_bones__hello; vga_console__clear (background => vga_console__black); vga_console__put__2 ("Hello, bare bones in Ada", 1, 1, foreground => vga_console__white, background => vga_console__black); line := 2; if magic = multiboot__magic_value then vga_console__put__2 ("Magic numbers match!", 1, 2, foreground => vga_console__white, background => vga_console__black); else vga_console__put__2 ("Magic numbers don't match!", 1, 2, foreground => vga_console__white, background => vga_console__black); [program_error "explicit raise"] end if; line := 3; bare_bones__t; R7b : constant integer := line + 1; [constraint_error when not (R7b in 1 .. 25) "range check failed"] line := R7b; B8b : declare begin vga_console__put__2 (bare_bones__hello, 1, line, foreground => vga_console__white, background => vga_console__black); end B8b; return; at end bare_bones___finalizer; end bare_bones; I'm lost. Anyone have any idea?