Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #73012

Re: Error compiling a module

From Alexander Villalba <alexvillalb159@gmail.com>
Newsgroups linux.debian.kernel
Subject Re: Error compiling a module
Date 2021-09-20 02:30 +0200
Message-ID <CZfm1-5zg-1@gated-at.bofh.it> (permalink)
References <CXGgG-3qY-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

I have not received any response on this problem

El mié, 15 sept 2021 a las 16:46, Alexander Villalba (<
alexvillalb159@gmail.com>) escribió:

> Dear Friends!:
>
> I've been compiling this code:
> https://github.com/bsalunke/SysCallInterceptModule
> and when executing make or ./compile.sh, it's report this error:
>
> /MyPath/SysCallInterceptModule-master/Module/SysCallInterceptModule.c:244:12:
> error: initialization of ‘ssize_t (*)(struct file *, char *, size_t,
>  loff_t *)’ {aka ‘long int (*)(struct file *, char *, long unsigned int,
>  long long int *)’} from incompatible pointer type ‘int (*)(struct file *,
> char *, size_t,  loff_t)’ {aka ‘int (*)(struct file *, char *, long
> unsigned int,  long long int)’} [-Werror=incompatible-pointer-types]
>
> The error stops being reported if I replace line 244 with:
>    .read = (ssize_t (*)(struct file *, char *, size_t,  loff_t *))
> &device_read,
>
> But was that really necessary?  I went through all the source code and
> couldn't find any other struct file_operations with a read function defined
> this way:
>
> int (*)(struct file *, char *, long unsigned int,  long long int)’}
>
> The error also didn't disappear if I declared the read function on line
> 147 as:
>
> static ssize_t  device_read(struct file* filep, char* buffer, size_t len,
> loff_t offset){
>
> I appreciate any explanation on why this occurs and / or any different
> solutions to avoid the error. Personally, it doesn't seem very logical to
> me.
>
>
>
>

Back to linux.debian.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Error compiling a module Alexander Villalba <alexvillalb159@gmail.com> - 2021-09-15 18:50 +0200
  Re: Error compiling a module Alexander Villalba <alexvillalb159@gmail.com> - 2021-09-20 02:30 +0200

csiph-web