1
0
mirror of https://github.com/golang/go synced 2024-10-05 12:21:22 -06:00
go/src/cmd
Russ Cox fe2ccb53c0 cc: add two new #pragma varargck
#pragma varargck countpos f 1
says that the first argument to f is
the count of variadic arguments that follow.

#pragma varargck type f t
says that t is one of the allowed types for
a variadic argument to f.
(can be repeated)

combined, these can be used to check the
runtime.stdcall functions in the windows port
or in any other port that needs a vararg list of
uintptrs even on a 64-bit platform (where it is
very easy to pass a less-than-uintptr in the ...).

demo:

typedef unsigned int uintptr;

#pragma varargck countpos f 1
#pragma varargck type f uintptr
#pragma varargck type f void*

int f(int count, ...);

void *v;
char *p;

void
main(void)
{
        f(1, v);  // ok
        f(1, main);  // ok
        f(1, p);  // ok
        f(2, v, v);  // ok

        f(2, v);  // found 1 argument after count 2
        f(1, 'a');  // invalid type INT in call to f
        f(1, 0);  // invalid type INT in call to f
}

R=ken, r, alex.brainman
CC=golang-dev
https://golang.org/cl/4634103
2011-06-27 22:42:34 -04:00
..
5a math: add sqrt_arm.s and sqrtGoC.go as fallback to soft fp emulation 2011-06-09 17:19:08 -04:00
5c 5c: do not use R9 and R10 2011-06-22 23:22:36 -04:00
5g 5g, 6g, 8g: fix comments in method call generation 2011-06-20 14:49:29 -04:00
5l 5l, 6l, 8l: drop use of ed during build 2011-06-27 12:03:19 -04:00
6a 5a, 6a, 8a, cc: remove old environment variables 2011-05-02 11:24:32 -04:00
6c cc: nit: silence comment warnings 2011-06-19 13:58:08 +10:00
6g 5g, 6g, 8g: fix comments in method call generation 2011-06-20 14:49:29 -04:00
6l 5l, 6l, 8l: drop use of ed during build 2011-06-27 12:03:19 -04:00
8a 8a: fixes for Plan 9 build 2011-06-27 14:42:18 -04:00
8c cc: nit: silence comment warnings 2011-06-19 13:58:08 +10:00
8g 5g, 6g, 8g: fix comments in method call generation 2011-06-20 14:49:29 -04:00
8l 5l, 6l, 8l: drop use of ed during build 2011-06-27 12:03:19 -04:00
cc cc: add two new #pragma varargck 2011-06-27 22:42:34 -04:00
cgo strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
cov Make.ccmd: link with mach lib, 2011-06-19 13:57:22 +10:00
ebnflint ebnflint: better handling of stdin 2011-06-24 17:29:19 -07:00
gc gc: avoid package name ambiguity in error messages 2011-06-27 18:44:30 -04:00
godefs godefs: rudimentary tests 2011-06-20 11:54:07 +10:00
godoc strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
gofix strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
gofmt strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
goinstall strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
gomake build: no required environment variables 2010-08-18 10:08:49 -04:00
gopack Make.ccmd: link with mach lib, 2011-06-19 13:57:22 +10:00
gotest gotest: add -test.benchtime and -test.cpu flags. 2011-06-27 13:31:40 -04:00
gotry gotry: move into its own directory, separate from gotest. 2011-03-29 13:00:24 -07:00
gotype os.Error API: don't export os.ErrorString, use os.NewError consistently 2011-06-22 10:52:47 -07:00
govet strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
goyacc strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
hgpatch strings.Split: make the default to split all. 2011-06-28 09:43:14 +10:00
ld ld: elide the Go symbol table when using -s 2011-06-27 14:39:38 -04:00
nm Make.ccmd: link with mach lib, 2011-06-19 13:57:22 +10:00
prof gopprof: update list of memory allocators 2011-06-21 11:27:08 -04:00
Makefile gotest: replace the shell script with the compiled program written in go. 2011-03-29 13:29:20 -07:00