comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Mixing Ada code with similar licenses
Date: Sun, 26 Mar 2017 13:57:00 -0700 (PDT)
Date: 2017-03-26T13:57:00-07:00	[thread overview]
Message-ID: <0bc08b9a-63e3-41bf-96d8-e9652c23a72a@googlegroups.com> (raw)
In-Reply-To: <o9ve6p$2pq$1@dont-email.me>

On Friday, March 10, 2017 at 6:54:44 PM UTC-5, Jeffrey R. Carter wrote:
> On 03/10/2017 10:20 PM, Jere wrote:
> >
> > In ada it would be something like (Rober's Impl)
> > procedure Clear_BSS is
> >       --  Suppress checking pointers from being zero (trust us)
> >       --  results in much better code
> >       pragma Suppress (Access_Check);
> >       type Int_Ptr is access all Integer_Address;
> >       function To_Access is
> >          new Ada.Unchecked_Conversion (Integer_Address, Int_Ptr);
> >       BSS_Start : Integer_Address := To_Integer (LD_BSS_Start'Address);
> >       BSS_End   : constant Integer_Address := To_Integer (LD_BSS_End'Address);
> >       Src : Int_Ptr;
> >    begin
> >       while BSS_Start < BSS_End
> >       loop
> >          Src := To_Access (BSS_Start);
> >          Src.all := 0; --  clear
> >          BSS_Start := BSS_Start + 4;
> >       end loop;
> >    end Clear_BSS;
> >
> > I would ideally just want to use that function with others, but implement my startup sequence that calls it a bit different.  My question is would that ada function (and the other two I mentioned above) fall under the regular GPL (no exception).
> 
> If you copy his code, then his license applies and your code that includes the 
> copied code is pure GPL.
> 
> However, if you can come up with a different (hopefully better) implementation, 
> then you get to choose the license. I might implement Clear_BSS as something like
> 
> procedure Clear_BSS is
>     Start : constant Integer_Address := To_Integer (BSS_Start_Address);
>     Stop  : constant Integer_Address := to_Integer (BSS_Stop_Address);
> 
>     BSS : Integer_Address := Start;
> begin -- Clear_BSS
>     Clear_All : loop
>        exit Clear_All when BSS >= Stop;
> 
>        Clear_One : declare
>           To_Clear : Integer_Address;
>           for To_Clear'Address use To_Address (BSS);
>           pragma Import (Ada, To_Clear); -- Suppress any initialization.
>        begin -- Clear_One
>           To_Clear := 0;
>        end Clear_One;
> 
>        BSS := BSS + 4;
>     end loop Clear_All;
> end Clear_BSS;
> 
> which looks to me like it does the same thing, but seems clearer. (I have no 
> objection to you using this with a license at least as permissive as the GPL + 
> exception.)
> 
> If you can do similar things to the other 2 subprograms, then you don't need to 
> make your code pure GPL.
> 
> -- 
> Jeff Carter
> "Violence is the last refuge of the incompetent."
> Foundation
> 151

Thank you!  I'll mess around with this method as well.  This does raise a
question for me though:  In function, both procedures do the same thing
(Use Integer_Address to loop through the addresses and convert to another
type to do the assignment).  I can see the style differences, but wondered
where the line was.  One could argue they do the same thing (I personally
can see the difference, but was trying to think from a outside perspective).

Also, how much of a method really is licensable?  If someone wrote the
function :

function Add_Numbers(A,B : in Integer) return Integer is
begin
   return A+B;
end Add_Numbers;

And stuck a pure GPL license on it, would any of my code that added two
numbers be under pure GPL from then on.  Common sense tells me "no" but
then legal matters don't always work with common sense.  In the same vein,
the BSS_Clear function of Robert's is simply a "loop through a pointer
and set each element to 0" function, which isn't ground breaking as well.
At what point is the method actually licenseable?

Note that I am not necessarily asking you directly Jeffery.  This is a
general musing.  I'm just musing along with my response to your post.

Again, thank you for the idea above.

  parent reply	other threads:[~2017-03-26 20:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ce508a3d-bd0f-4ecc-953e-5b624c072b3c@googlegroups.com>
     [not found] ` <o9ur48$p6c$1@dont-email.me>
     [not found]   ` <f1f579b9-54b9-4949-941a-9b10821892b5@googlegroups.com>
2017-03-11  9:05     ` Mixing Ada code with similar licenses Dirk Heinrichs
     [not found] ` <lyk27wdeku.fsf@pushface.org>
2017-03-26 20:46   ` Jere
2017-03-26 21:12     ` Simon Wright
     [not found] ` <o9v343$pf5$1@dont-email.me>
     [not found]   ` <86633a07-9a12-4419-ad09-b519e4f279a5@googlegroups.com>
     [not found]     ` <o9ve6p$2pq$1@dont-email.me>
2017-03-26 20:57       ` Jere [this message]
2017-03-26 21:24         ` Jeffrey R. Carter
2017-03-27  7:07           ` Simon Wright
replies disabled

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