mirror of
https://github.com/0xAX/linux-insides.git
synced 2024-12-22 14:48:08 +00:00
Fix some mixed types in asm.md.
This commit fixes some instances where return types did not match the type of the variable being returned or printf format strings did not match the types of arguments.
This commit is contained in:
parent
c488370cc3
commit
5954812ed2
@ -307,7 +307,7 @@ a = 100
|
|||||||
Or for example the `I` constraint which represents a `32-bit` integer. The difference between the `i` and `I` constraints is that `i` is more general, while `I` is for strictly `32-bit` integer data. For example if you try to compile the following example:
|
Or for example the `I` constraint which represents a `32-bit` integer. The difference between the `i` and `I` constraints is that `i` is more general, while `I` is for strictly `32-bit` integer data. For example if you try to compile the following example:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
int test_asm(int nr)
|
unsigned long test_asm(int nr)
|
||||||
{
|
{
|
||||||
unsigned long a = 0;
|
unsigned long a = 0;
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ test.c:7:9: error: impossible constraint in ‘asm’
|
|||||||
when:
|
when:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
int test_asm(int nr)
|
unsigned long test_asm(int nr)
|
||||||
{
|
{
|
||||||
unsigned long a = 0;
|
unsigned long a = 0;
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ int main(void)
|
|||||||
static unsigned long element;
|
static unsigned long element;
|
||||||
|
|
||||||
__asm__ volatile("movq 16+%1, %0" : "=r"(element) : "o"(arr));
|
__asm__ volatile("movq 16+%1, %0" : "=r"(element) : "o"(arr));
|
||||||
printf("%d\n", element);
|
printf("%lu\n", element);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -85,3 +85,4 @@ Thank you to all contributors:
|
|||||||
* [Piyush Pangtey](https://github.com/pangteypiyush)
|
* [Piyush Pangtey](https://github.com/pangteypiyush)
|
||||||
* [Alfred Agrell](https://github.com/Alcaro)
|
* [Alfred Agrell](https://github.com/Alcaro)
|
||||||
* [Jakub Wilk](https://github.com/jwilk)
|
* [Jakub Wilk](https://github.com/jwilk)
|
||||||
|
* [Matthew Fernandez](https://github.com/Smattr)
|
||||||
|
Loading…
Reference in New Issue
Block a user