C99 Compliance #28
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Telodendria/Cytoplasm#28
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ANSI C89 is not actually POSIX. POSIX specifies only C99. To maintain compliance with POSIX, ensuring broader portability of the code base, we should really upgrade to C99.
This involves:
Setting the
-std=c99
compile flag.Removing the
Int.h
,Int64.h
,UInt64.h
, and other headers and their accompanying code that can be replaced bystdint.h
. Also included in this is refactoring any code that uses the custom integer types to use thestdint.h
types instead.Using
stdbool.h
andbool
everywhere it is semantically correct, at least in the public API. Private use may still useint
we come across places where it should bebool
, then we should change them.Updating
printf()
format specifiers to use%zu
forsize_t
.Determining what the style guide will be going forward.
//
comments allowed?I am inclined to answer "no" and "yes" to these respectively. If we are targetting C99, we should be okay with using C99 features, as long as they don't hinder readability. However, there are some features that we should avoid because they are not widely supported, including VLAs, floating point pragmas, and complex numbers. I don't anticipate any of those being a problem though.
We are already using C99 functions such as
snprintf()
, so we aren't even strictly C89 compliant anyway.A part of this initiative should also be to deal with #12, #16, and #20.
Once C99 compliance is achieved, we can upgrade Telodendria as well. I imagine that there will be a number of breaking changes that will affect Telodendria.