Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* __STDC_VERSION__ : What C dialect c89, c99,gnu90 kernel compiies
@ 2020-05-20  7:30 Lev R. Oshvang .
  2020-05-20  8:44 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Lev R. Oshvang . @ 2020-05-20  7:30 UTC (permalink / raw)
  To: kernelnewbies

Hi All,

I am building out of tree kernel module.

I am trying to include user-space lib into kernel module

This  API gives me the following warning :

"__STDC_VERSION__" is not defined, evaluates to 0

But continues and resulted module works,

I see from https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
that _STDC_VERSION__ is a built-in gcc macro, so I think that evenh
kernel compilation should be able to see it.

Please comment
Lev.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: __STDC_VERSION__ : What C dialect c89, c99,gnu90 kernel compiies
  2020-05-20  7:30 __STDC_VERSION__ : What C dialect c89, c99,gnu90 kernel compiies Lev R. Oshvang .
@ 2020-05-20  8:44 ` Greg KH
  2020-05-20 15:13   ` 67hz
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-05-20  8:44 UTC (permalink / raw)
  To: Lev R. Oshvang .; +Cc: kernelnewbies

On Wed, May 20, 2020 at 10:30:53AM +0300, Lev R. Oshvang . wrote:
> Hi All,
> 
> I am building out of tree kernel module.

Did you read the kernel documentation for how to do this?

> I am trying to include user-space lib into kernel module

You can't do this, sorry, it's not allowed at all, unless you build the
code for that library into your kernel module directly.

What problem are you trying to solve with this?

> This  API gives me the following warning :
> 
> "__STDC_VERSION__" is not defined, evaluates to 0
> 
> But continues and resulted module works,
> 
> I see from https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
> that _STDC_VERSION__ is a built-in gcc macro, so I think that evenh
> kernel compilation should be able to see it.

There is no standard c library within the kernel, sorry.

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: __STDC_VERSION__ : What C dialect c89, c99,gnu90 kernel compiies
  2020-05-20  8:44 ` Greg KH
@ 2020-05-20 15:13   ` 67hz
  0 siblings, 0 replies; 3+ messages in thread
From: 67hz @ 2020-05-20 15:13 UTC (permalink / raw)
  To: Greg KH; +Cc: Lev R. Oshvang ., kernelnewbies


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 3:44 AM, Greg KH <greg@kroah.com> wrote:

> On Wed, May 20, 2020 at 10:30:53AM +0300, Lev R. Oshvang . wrote:
>
> > Hi All,
> > I am building out of tree kernel module.
>
> Did you read the kernel documentation for how to do this?
>
> > I am trying to include user-space lib into kernel module
>
> You can't do this, sorry, it's not allowed at all, unless you build the
> code for that library into your kernel module directly.
>
> What problem are you trying to solve with this?
>
> > This API gives me the following warning :
> > "STDC_VERSION" is not defined, evaluates to 0
> > But continues and resulted module works,
> > I see from https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
> > that STDC_VERSION_ is a built-in gcc macro, so I think that evenh
> > kernel compilation should be able to see it.
>
> There is no standard c library within the kernel, sorry.
>

If you are curious which symbols are in the kernel's scope, i.e., what functions are available to the kernel, check out /proc/kallsyms.



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  7:30 __STDC_VERSION__ : What C dialect c89, c99,gnu90 kernel compiies Lev R. Oshvang .
2020-05-20  8:44 ` Greg KH
2020-05-20 15:13   ` 67hz

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git