standard-library

implicit declaration warning: What are the built-in functions?

£可爱£侵袭症+ 提交于 2021-02-08 07:44:59
问题 The question-asking interface is flagging many "Questions that may already have your answer", but I have attempted to do due diligence to check if any are asking exactly what I am here. My apologies if this is a duplicate. Suppose I have the following incorrect program: extern void undefined_function(void); int main(int argc, char **argv) { undefined_function(); undeclared_function(); exit(0); } Compiling with gcc gives: $ gcc warnings.c warnings.c: In function ‘main’: warnings.c:6:2: warning

Heapq module implementation

风格不统一 提交于 2021-02-08 06:18:09
问题 I was reading the heapq module source because I reviewed a question on CodeReview and I cannot understand something. In the wikipedia article about heap it says: sift-up: move a node up in the tree, as long as needed; used to restore heap condition after insertion. Called "sift" because node moves up the tree until it reaches the correct level, as in a sieve. sift-down: move a node down in the tree, similar to sift-up; used to restore heap condition after deletion or replacement. But the code

How do I use Agda's implementation of delimited continuations?

好久不见. 提交于 2021-02-07 14:16:00
问题 We can implement a delimited continuation monad in Agda rather easily. There is, however, no need to, as the Agda "standard library" has an implementation of a delimited continuation monad. What confuses me about this implementation, though, is the addition of an extra parameter to the DCont type. DCont : ∀ {i f} {I : Set i} → (I → Set f) → IFun I f DCont K = DContT K Identity My question is: why is the extra parameter K there? And how would I use the DContIMonadDCont instance? Can I open it

what is libc? what are the functions it includes? how can we get the source code of it?

こ雲淡風輕ζ 提交于 2021-02-07 13:53:40
问题 As per Wikipedia there are many variants of standard C library based on operating system and compilers. Ref: http://en.wikipedia.org/wiki/C_standard_library But I want to understand that how plenty of functions which are declared in different headers(eg: stdio.h, string.h, stdlib.h etc. ) are defined in single library. Is the source code file is same for all these header files or there are different libraries for stdio.h, string.h etc? As I am beginner to programming I don't know if multiple

what is libc? what are the functions it includes? how can we get the source code of it?

亡梦爱人 提交于 2021-02-07 13:53:26
问题 As per Wikipedia there are many variants of standard C library based on operating system and compilers. Ref: http://en.wikipedia.org/wiki/C_standard_library But I want to understand that how plenty of functions which are declared in different headers(eg: stdio.h, string.h, stdlib.h etc. ) are defined in single library. Is the source code file is same for all these header files or there are different libraries for stdio.h, string.h etc? As I am beginner to programming I don't know if multiple

Is undefined behavior possible in safe Rust?

我怕爱的太早我们不能终老 提交于 2021-01-28 03:21:26
问题 Is there any way to achieve undefined behavior in Rust without using unsafe ? Of course, such behavior can be wrapped by a third-party library in a "safe" function so let's assume we're using only the standard one. 回答1: Absolutely, but any such case is a bug with Rust or the standard libary. My favorite example is LLVM loop optimization can make safe programs crash, which actually occurs due to a poor interaction of Rust and LLVM semantics: pub fn oops() { (|| loop { drop(42) })() } Compiled

Macro Operator List

99封情书 提交于 2021-01-27 11:28:10
问题 I know about Macro's Stringizing operator ( # ) and I recently learned about the ( ## ) Concatenation operator: Preprocessor Stringizing Operator with String Literal Prefixes Are there any other macro operators that are available to me? I know that Boost has a pretty extensive suite that they've put together, however for the purposes of this question I'm just asking about Macro operator support defined by the standard. 回答1: As is mentioned by Cyber's comment the Sringizing ( # ) and

Macro Operator List

拈花ヽ惹草 提交于 2021-01-27 11:26:30
问题 I know about Macro's Stringizing operator ( # ) and I recently learned about the ( ## ) Concatenation operator: Preprocessor Stringizing Operator with String Literal Prefixes Are there any other macro operators that are available to me? I know that Boost has a pretty extensive suite that they've put together, however for the purposes of this question I'm just asking about Macro operator support defined by the standard. 回答1: As is mentioned by Cyber's comment the Sringizing ( # ) and

Macro Operator List

蹲街弑〆低调 提交于 2021-01-27 11:25:24
问题 I know about Macro's Stringizing operator ( # ) and I recently learned about the ( ## ) Concatenation operator: Preprocessor Stringizing Operator with String Literal Prefixes Are there any other macro operators that are available to me? I know that Boost has a pretty extensive suite that they've put together, however for the purposes of this question I'm just asking about Macro operator support defined by the standard. 回答1: As is mentioned by Cyber's comment the Sringizing ( # ) and