Lines Matching full:and

12 Zephyr supports applications written in both C and C++. However, to use C++ in
17 and the included compiler must be supported by the Zephyr build system. The
19 is supported by Zephyr, and the features and their availability documented
25 :kconfig:option:`CONFIG_STD_CPP98`. The oldest standard supported and
37 should not return status information and should, instead, return zero.
59 * Dynamic object management with the **new** and **delete** operators
76 of the C++ standard library and application binary interface (ABI) functions to
79 * ``new`` and ``delete`` operators
80 * virtual function stub and vtables
84 C++ language support, and it does not implement any `Standard Template Library
85 (STL)`_ classes and functions. For this reason, it is only suitable for use in
86 the applications that implement their own (non-standard) class library and do
90 components, such as ``std::string`` and ``std::vector``, must enable the C++
96 The `C++ Standard Library`_ is a collection of classes and functions that are
125 Header files and incompatibilities between C and C++
128 To interact with each other, C and C++ must share code through header
129 files: data structures, macros, static functions,... While C and C++
133 inspired by and copied from the other language but many years later and
137 different compilers. Compilers can have bugs and these may need
142 just because they have to be compatible between C and C++, but also
144 source files due to *indirect* inclusion and the `lack of structure and
146 files are exposed to a much larger variety of toolchains and project
149 with respect to code style, compiler warnings, static analyzers and
154 practices" and lessons learned in a Zephyr-specific context. While a lot
156 substitute for knowledge of C/C++ standards, textbooks and other
162 Fortunately, the Zephyr project has an extensive test and CI
164 enforces policies and maintains such combinatorial explosions under some
176 boilerplate code. C99 added initialization of ``struct`` and ``union``
182 error-prone, more readable and more flexible. On the other hand, C99
183 allowed a surprisingly large and lax set of possibilities: designated
185 various other braces can be omitted, designated initializers and not can
191 with C) or in any complete C++ reference, a mix is not allowed and
196 ``gcc -std=c++17``. For example, ``gcc -std=c++17`` and older allow the
197 C-style mix of initializers and bare expressions. This fails to compile
200 Recommendation: to maximize compatibility across different C and C++
201 toolchains and standards, designated initializers in Zephyr header files
202 should follow all C++20 rules and restrictions. Non-designated, pre-C99
203 initialization offers more compatibility and is also allowed but
204 designated initialization is the more readable and preferred code
212 evaluation order (here and elsewhere).
219 As usual, there are differences between C and C++. For instance, C
229 required by C++20 and above which perceive such braces as mixing bare
230 expressions with (other) designated initializers and fails to compile.
233 Maybe because C is laxer and allows many initialization possibilities
234 and variations, so it may need such braces to disambiguate? Note C
244 <https://github.com/zephyrproject-rtos/zephyr/commit/c15f029a7108>`_ and
251 .. _`lack of structure and headers organization`: