This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gccgo] Add documentation
- From: Ian Lance Taylor <iant at google dot com>
- To: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Sat, 20 Nov 2010 18:24:09 -0800
- Subject: Re: [gccgo] Add documentation
- References: <mcripzuney4.fsf@google.com> <20101120072429.GF30736@gmx.de>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
> * Ian Lance Taylor wrote on Fri, Nov 19, 2010 at 04:57:07AM CET:
>
>> +@c man begin OPTIONS gccgo
>> +
>> +@table @gcctabopt
>> +@item -I@var{dir}
>> +@cindex @option{-I}
>
> FWIW, gcc.texi uses a separate option index, and indexes options with
> leading - or -- removed, so in the PDF they don't all sort under the
> same character. Might this be useful for this manual, too, or do you
> expect the size to remain small so this isn't a problem?
I don't expect this manual to ever get very large.
>> +Specify a directory to use when searching for an import package at
>> +compile time.
>> +
>> +@item -L@var{dir}
>> +@cindex @option{-L}
>> +When compiling, synonymous with @option{-I}.
>
> Interesting. Why?
The first reason is that that way when doing
gccgo -o foo foo.go
you don't have to use both -I and -L options to find the packages to
import.
The second reason is that %D in the gcc specs language gives the right
search path for gccgo to import system packages, but it generates -L
options, not -I option.
>> +The type of a Go function with no receiver is equivalent to a C
>> +function whose parameter types are equivalent. When a Go function
>> +returns more than one value, the C function returns a struct. For
>> +example, these functions have equivalent types:
>> +
>> +@smallexample
>> +func GoFunction(int) (int, float)
>> +struct @{ int i; float f; @} CFunction(int)
>> +@end smallexample
>
> Since IIUC in C99 two struct types are only equivalent if both member
> types are compatible and member names are the same, is there a canonical
> way to create the member names here?
It's irrelevant. Nothing is going to type check the field names against
each other--in fact, there is no way to type check this construct at
all. This is what you need to do to achieve ABI compatibility, and you
just have to get it right.
> I'd suggest:
> ... is mirrored from the @uref{http://code.google.com/@/p/@/go, master
> Go repository}.
>
> for nice PDF URL rendering and line wrapping.
> Similarly:
> The Go language continues to evolve as of this writing, see the
> @uref{http://golang.org/@/doc/@/go_spec.html, current language
> specifications}.
Done and done.
Thanks!
Ian