search for: __const__

Displaying 9 results from an estimated 9 matches for "__const__".

Did you mean: __const
2008 Jul 10
2
[PATCH] PV-GRUB: xfs support
...sys_xfs.c =================================================================== RCS file: /sources/grub/grub/stage2/fsys_xfs.c,v retrieving revision 1.5 diff -u -p -r1.5 fsys_xfs.c --- fsys_xfs.c 8 May 2005 02:18:14 -0000 1.5 +++ fsys_xfs.c 10 Jul 2008 13:09:50 -0000 @@ -101,7 +101,7 @@ static inline __const__ xfs_uint16_t le16 (xfs_uint16_t x) { __asm__("xchgb %b0,%h0" \ - : "=q" (x) \ + : "=Q" (x) \ : "0" (x)); \ return x; } @@ -109,9 +109,9 @@ le16 (xfs_uint16_t x) static inline __const__ xfs_uint32_t le32 (xfs_uint32_t x) { -#if 0 +#if 1...
2017 Mar 21
4
Clang -O0 performs optimizations that undermine dynamic bug-finding tools
...(at least in theory) could be detected by bug finding tools. However, Clang optimizes the calls away, so bug finding tools have no chance to find the out-of-bounds accesses. Note, that in this example no warning is printed. I think the calls are removed since __ctype_b_loc() has an __attribute__ ((__const__)). When the attribute is used, Clang -O0 also removes calls in other instances, for example in the function below. Using pure instead of const as an attribute has the same effect. #include <stdio.h> int arr[10]; void test() __attribute__ ((__const__)); void test(int index) { printf(&q...
2004 Jun 23
4
CRIS port of klibc
...of divmod worker function. */ +struct quot_rem + { + long quot; + long rem; + }; + +/* This is the worker function for div and mod. It is inlined into the + respective library function. */ +static __inline__ struct quot_rem +do_31div (unsigned long a, unsigned long b) + __attribute__ ((__const__, __always_inline__)); + +static __inline__ struct quot_rem +do_31div (unsigned long a, unsigned long b) +{ + /* Adjust operands and result if a is 31 bits. */ + long extra = 0; + int quot_digits = 0; + + if (b == 0) + { + struct quot_rem ret; + ret.quot = 0xffffffff; + ret.re...
2012 Jan 21
1
[PATCH] include/checkpatch: Prefer __scanf to __attribute__((format(scanf, ...)
...bute__((aligned(x))) -#define __printf(a,b) __attribute__((format(printf,a,b))) +#define __printf(a, b) __attribute__((format(printf, a, b))) +#define __scanf(a, b) __attribute__((format(scanf, a, b))) #define noinline __attribute__((noinline)) #define __attribute_const__ __attribute__((__const__)) #define __maybe_unused __attribute__((unused)) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e834342..30f21ec 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -315,10 +315,10 @@ extern __printf(2, 3) char *kasprintf(gfp_t gfp, const char *fmt, ...); ex...
2012 Jan 21
1
[PATCH] include/checkpatch: Prefer __scanf to __attribute__((format(scanf, ...)
...bute__((aligned(x))) -#define __printf(a,b) __attribute__((format(printf,a,b))) +#define __printf(a, b) __attribute__((format(printf, a, b))) +#define __scanf(a, b) __attribute__((format(scanf, a, b))) #define noinline __attribute__((noinline)) #define __attribute_const__ __attribute__((__const__)) #define __maybe_unused __attribute__((unused)) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e834342..30f21ec 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -315,10 +315,10 @@ extern __printf(2, 3) char *kasprintf(gfp_t gfp, const char *fmt, ...); ex...
2020 Nov 18
0
[RFC] Coroutine and pthread_self
Hi, I would like to propose a potential solution to a bug that involves coroutine and pthread_self(). Description of the bug can be found in https://bugs.llvm.org/show_bug.cgi?id=47833. Below is a summary: pthread_self() from glibc is defined with "__attribute__ ((__const__))". The const attribute tells the compiler that it does not read nor write any global state and hence always return the same result. Hence in the following code: auto x1 = pthread_self(); ... auto x2 = pthread_self(); the second call to pthread_self() can be optimized out. This has been corr...
2004 May 14
2
request: allow inline functions in R
...compiled with `-ansi', while the keywords const, volatile, signed, typeof and inline won't work in a program compiled with `-traditional'. The way to solve these problems is to put `__' at the beginning and end of each problematical keyword. For example, use __asm__ instead of asm, __const__ instead of const, and __inline__ instead of inline. Other C compilers won't accept these alternative keywords; if you want to compile with another compiler, you can define the alternate keywords as macros to replace them with the customary keywords. It looks like this: #ifndef __GNUC__ #d...
2012 Nov 29
2
[LLVMdev] problem trying to write an LLVM register-allocation pass
I have a new problem: Register RBP is used in a function foo. (I am not allocating RBP to any virtual register, the instances of RBP in function foo are in the machine code when my register allocator starts.) Function foo calls function bar. Register RBP is not saved across the call, though it is live after the call. Function bar includes a virtual register. The code that I'm using to
2012 Dec 01
0
[LLVMdev] problem trying to write an LLVM register-allocation pass
...te__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *rindex (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure...