c99 Questions

3

Solved

C99 defines these three as macros that "are expressions of type ‘‘pointer to FILE’’ that point to the FILE objects associated, respectively, with the standard error, input, and output streams&...
Uncertainty asked 30/5, 2023 at 13:8

2

Solved

enum elements' names are susceptible to overlap/collide with both other enum elements names, variable names, etc... enum Fruit { apple, orange }; typedef enum Fruit Fruit; enum Color { red, ...
Thalia asked 13/2, 2016 at 13:8

2

Solved

I have problem with interpretation of C standard, the latest draft taken from http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2454.pdf. Standard evaluation The standard defines pragma STD FENV_...
Bennir asked 17/3, 2020 at 5:58

6

Solved

Just was looking something up in the ISO/IEC9899 When I stumbled on this: 6.7.6 Type names [...] Semantics 2 In several contexts, it is necessary to specify a type. This is accomplished...
Trimly asked 17/12, 2014 at 15:45

3

I'm trying to get long long from the console using standard IO function scanf. I started with %lld: scanf("%lld", &rule); That throws: error: unknown conversion type character 'l' in format...
Etruria asked 18/5, 2014 at 2:53

4

Solved

When you have string in C, you can add direct hex code inside. char str[] = "abcde"; // 'a', 'b', 'c', 'd', 'e', 0x00 char str2[] = "abc\x12\x34"; // 'a', 'b', 'c', 0x12, 0x34, 0x00 Both example...
Cuvette asked 10/8, 2017 at 11:44

9

Solved

Is there a printf width specifier which can be applied to a floating point specifier that would automatically format the output to the necessary number of significant digits such that when scanning...
Eternize asked 30/5, 2013 at 15:4

2

Solved

The following code cannot be compiled when put inside a scope/function, the compiler will produce an error stating something along the lines of initializer element is not constant. This happens on ...
Manchester asked 13/11, 2017 at 11:52

3

Solved

I was wondering if there were any files in which I could set the -std=c99 flag, so that I would not have to set it for every compilation. I am using GCC 4.4 on Ubuntu.
Vic asked 3/2, 2010 at 16:46

5

Solved

I learned today that there are digraphs in C99 and C++. The following is a valid program: %:include <stdio.h> %:ifndef BUFSIZE %:define BUFSIZE 512 %:endif void copy(char d<::>, cons...
Arathorn asked 11/1, 2009 at 6:7

4

Solved

I have included the header netdb.h, where getaddrinfo is included, but gcc issues this warning: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared librar...
Trillion asked 27/4, 2010 at 21:25

4

When using gcc or clang, it's generally a good idea to enable a number of warnings, and a first batch of warnings is generally provided by -Wall. This batch is pretty large, and includes the specif...
Zulmazulu asked 28/1, 2020 at 23:49

6

Solved

I read several questions in stackoverflow about inline in C but still am not clear about it. static inline void f(void) {} has no practical difference with static void f(void) {}. inline void f(v...
Insulation asked 29/6, 2015 at 5:8

4

isnan(), isinf() was not in the spec until C99, is there anyway to implement such a function in C89? i could use if (d * 0 != 0) to check if d was NaN or Inf, but we always compile our project wit...
Hilbert asked 18/1, 2020 at 3:44

10

Solved

I was wondering if it is possible to iterate over arguments passed to a variadic macro in C99 or using any GCC extensions ? For e.g. is it possible to write a generic macro that takes a structure ...
Andesine asked 9/12, 2009 at 7:35

3

Solved

I was browsing through some documentation and questions/answers and saw it mentioned. I read a brief description, stating that it would be basically a promise from the programmer that the pointer w...
Sheathbill asked 14/4, 2009 at 0:9

4

Solved

I was wondering what the best way to deal with code containing GCC's __attribute__ extension when using MSVC. Is the following a safe way of dealing with this: #define __attribute__(x) /* blank - ...
Fitted asked 9/2, 2015 at 13:50

8

Solved

This might sound like an interview question but is actually a practical problem. I am working with an embedded platform, and have available only the equivalents of those functions: printf() snprin...
Sweeney asked 17/12, 2013 at 16:33

3

Solved

What are the C standard fixed width floating point types and where are they defined? From MISRA-C:2004, Rule 6.3: typedefs that indicate size and signedness should be used in place of the basic num...
Ceasefire asked 27/5, 2022 at 23:34

7

Solved

When I ask to see the current version of cc I get this. $ cc --version cc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the sour...
Artery asked 6/2, 2013 at 19:24

4

Solved

The C Programming Language by Brian Kernighan and Dennis Ritchie contains a lot of examples such as this famous one (K&R 2nd edition 1.1): #include <stdio.h> main() { printf("hello...
Moldboard asked 17/5, 2022 at 13:38

9

Solved

The C99 standard introduces the following datatypes. The documentation can be found here for the AVR stdint library. uint8_t means it's an 8-bit unsigned type. uint_fast8_t means it's the fastest...
Smithereens asked 28/1, 2016 at 7:15

7

Solved

I've been searching a portable way to force CMake to enable the compiler's C99 features in order to avoid the following gcc error for instance: error: ‘for’ loop initial declarations are only allo...
Entellus asked 19/7, 2014 at 11:44

6

Solved

In C99, I include stdint.h and that gives me UINT32_MAX as well as uint32_t data type. However, in C++ the UINT32_MAX gets defined out. I can define __STDC_LIMIT_MACROS before including stdint.h, b...
Clorindaclorinde asked 24/9, 2009 at 12:23

3

Solved

I'm writing some serial code on a raspberry pi and switched to C99. When I did I started getting the error "error: ‘CRTSCTS’ undeclared (first use in this function)" $ c99 -M serial01.c | grep ter...
Intradermal asked 15/11, 2014 at 8:55

© 2022 - 2025 — McMap. All rights reserved.