naming conventions - "most common" typedef for basic types in C -


i had small discussion @ work since decided go new naming convention basic typedefs c.

their argument follow common naming convention used c developers. now, don't care change, wondering there such thing? 'most common naming convention among c programmers'. know windows tends use naming word , dword etc.

they decided go from:

  • u8bit uint8_t
  • s8bit int8_t
  • etc.

as said, there's no real naming convention, can rely on libc style (using _t suffix, use uppercase macro … )

for you're example, don't know how decision made, such types exists in c99 standard header stdint.h: signed type have form ints_t s replaced size in bits , unsigned types have form uints_t (with s … )

so, uint8_t exists in standard , signed version ,int8_t (and not sint8_t.) redefining them waste of time, should prefer provided standard.

using provided definition has other advantages: don't have worry how correctly define sizes (remember, lot of integer types don't have same size across various architecture , oses, may have different signedness !)


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -