LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What's the meaning of "undefined names"? see the details in the attached picture. (https://www.linuxquestions.org/questions/programming-9/whats-the-meaning-of-undefined-names-see-the-details-in-the-attached-picture-4175648593/)

Yuc 02-19-2019 12:01 AM

What's the meaning of "undefined names"? see the details in the attached picture.
 
1 Attachment(s)
I can't understand the sentence :The C compiler uses a
predefined library of functions (the C library) that have the names of the system
calls, thus resolving the system call references in the user program to what would
otherwise be undefined names.


This is my understanding part of it: the c library has some functions that are with the same names of system calls but I can't understand the behind part of it. What's the meaning of "undefined names"? Does it mean system calls that don't have names?

I'm really sorry for if it is a problem of my english.

thank you.

rtmistler 02-19-2019 06:15 AM

It is just pointing out that the libraries installed contain system functions that you call as part of a module or program.

Do you have any programming experience, or have you ever looked at, and compile any C programs?

dugan 02-19-2019 01:16 PM

What book is that picture from?

BW-userx 02-19-2019 01:45 PM

to add to what @rtmistler said,

therefore, if you make a "system call", or otherwise, and there is nothing to reference it, (the function call) to, then logic states, it is undefined, and will tell you so. example

Code:

#include <stdio.h>
int main (void)
{

gofunny();

return 0;
}

// output
$ gcc  udef.c
udef.c: In function ‘main’:
udef.c:9:1: warning: implicit declaration of function ‘gofunny’ [-Wimplicit-function-declaration]
 gofunny();
 ^~~~~~~
/usr/bin/ld: /tmp/ccJfv1JF.o: in function `main':
udef.c:(.text+0xa): undefined reference to `gofunny'
collect2: error: ld returned 1 exit status

The header files are where the functions are defined. Keep reading...

astrogeek 02-19-2019 01:50 PM

It says, "The C library used by the compiler defines these system calls. If it did not they would be (otherwise) undefined."

It would be helpful when asking questions in the context of some external documentation, to include the name of that documentation or a link to the source so that others might better understand the context of the question.

Yuc 02-19-2019 07:48 PM

Quote:

Originally Posted by rtmistler (Post 5963956)
It is just pointing out that the libraries installed contain system functions that you call as part of a module or program.

Do you have any programming experience, or have you ever looked at, and compile any C programs?

Yes,but a little. Thank you for the help.

Yuc 02-19-2019 07:50 PM

Quote:

Originally Posted by dugan (Post 5964121)
What book is that picture from?

it's the book <the design of the unix operating system>


All times are GMT -5. The time now is 11:21 AM.