Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for __attribute__ (1.85 sec)

  1. src/cmd/cgo/internal/test/issue4273.c

    // Copyright 2012 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    #ifdef __ELF__
    __attribute__((weak))
    __attribute__((visibility("hidden")))
    void _compilerrt_abort_impl(const char *file, int line, const char *func) {
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 320 bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/testsanitizers/testdata/msan5.go

    /*
    #include <stdlib.h>
    
    extern void Go1(int*);
    extern void Go2(char*);
    
    // Use weak as a hack to permit defining a function even though we use export.
    void C1() __attribute__ ((weak));
    void C2() __attribute__ ((weak));
    
    void C1() {
    	int i;
    	Go1(&i);
    	if (i != 42) {
    		abort();
    	}
    }
    
    void C2() {
    	char a[2];
    	a[1] = 42;
    	Go2(a);
    	if (a[0] != 42) {
    		abort();
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 904 bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/testsanitizers/testdata/msan8.go

    // msan is concerned. It just waits for a signal.
    // Because the registers are msan-undefined, the signal handler will
    // be invoked with all registers msan-undefined.
    __attribute__((noinline))
    void msanGoWait(unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long a6) {
    	sigset_t mask;
    
    	sigemptyset(&mask);
            sigsuspend(&mask);
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:30:58 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  4. src/cmd/cgo/internal/testsanitizers/testdata/tsan2.go

    extern void GoRun(void);
    
    // Yes, you can have definitions if you use //export, as long as they are weak.
    
    int val __attribute__ ((weak));
    
    int run(void) __attribute__ ((weak));
    
    int run() {
    	val = 1;
    	GoRun();
    	return val;
    }
    
    void setVal(int) __attribute__ ((weak));
    
    void setVal(int i) {
    	val = i;
    }
    */
    import "C"
    
    import "runtime"
    
    //export GoRun
    func GoRun() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 940 bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testcarchive/testdata/main4.c

    static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
    }
    
    // Set up the SIGIO signal handler in a high priority constructor, so
    // that it is installed before the Go code starts.
    
    static void init(void) __attribute__ ((constructor (200)));
    
    static void init() {
    	struct sigaction sa;
    
    	memset(&sa, 0, sizeof sa);
    	sa.sa_sigaction = ioHandler;
    	if (sigemptyset(&sa.sa_mask) < 0) {
    		die("sigemptyset");
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  6. src/cmd/cgo/internal/test/issue29563/weak1.c

    // Copyright 2019 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    extern int weaksym __attribute__((__weak__));
    int weaksym = 42;
    
    int foo1()
    {
    	return weaksym;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 257 bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/test/issue29563/weak2.c

    // Copyright 2019 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    extern int weaksym __attribute__((__weak__));
    int weaksym = 42;
    
    int foo2()
    {
    	return weaksym;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 257 bytes
    - Viewed (0)
  8. src/cmd/cgo/internal/testsanitizers/testdata/msan3.go

    // license that can be found in the LICENSE file.
    
    package main
    
    /*
    extern int *GoFn(int *);
    
    // Yes, you can have definitions if you use //export, as long as they are weak.
    int f(void) __attribute__ ((weak));
    
    int f() {
      int i;
      int *p = GoFn(&i);
      if (*p != 12345)
        return 0;
      return 1;
    }
    */
    import "C"
    
    //export GoFn
    func GoFn(p *C.int) *C.int {
    	*p = C.int(12345)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 552 bytes
    - Viewed (0)
  9. src/cmd/cgo/out.go

    	if *importRuntimeCgo {
    		fmt.Fprintf(fm, "void crosscall2(void(*fn)(void*) __attribute__((unused)), void *a __attribute__((unused)), int c __attribute__((unused)), size_t ctxt __attribute__((unused))) { }\n")
    		fmt.Fprintf(fm, "size_t _cgo_wait_runtime_init_done(void) { return 0; }\n")
    		fmt.Fprintf(fm, "void _cgo_release_context(size_t ctxt __attribute__((unused))) { }\n")
    		fmt.Fprintf(fm, "char* _cgo_topofstack(void) { return (char*)0; }\n")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 16:41:10 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/testsanitizers/testdata/msan4.go

    /*
    #include <time.h>
    #include <unistd.h>
    
    extern void Nop(char*);
    
    // Use weak as a hack to permit defining a function even though we use export.
    void poison() __attribute__ ((weak));
    
    // Poison the stack.
    void poison() {
    	char a[1024];
    	Nop(&a[0]);
    }
    
    */
    import "C"
    
    import (
    	"runtime"
    )
    
    func main() {
    	runtime.MemProfileRate = 1
    	start(100)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 878 bytes
    - Viewed (0)
Back to top