Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #67653

Re: type safety on simple data types - without structs?

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: type safety on simple data types - without structs?
Date 2015-08-18 11:11 +1200
Message-ID <d3f80eF2rqoU1@mid.individual.net> (permalink)
References <mqtoj6$8co$1@dont-email.me>

Show all headers | View raw


mathog wrote:
> I'm working on a bit of code which has some packed data types.  These
> have records that are funny lengths, like 11 bytes, so the data is
> accessed by a bunch of get()/set() routines which either take a char *
> pointer to the start of one of these records, or an integer index for
> the record number.  For the sake of argument, let all of those indices
> be uin64_t.
>
> The question is, is there some magic way to make a type safe version of
> these simple types in C, perhaps something added in c99 or later?

I don't think there is in C99, but if you consider C++ to be something 
added later then the answer is yes :)

-- 
Ian Collins

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

type safety on simple data types - without structs? mathog <dmathog@gmail.com> - 2015-08-17 15:52 -0700
  Re: type safety on simple data types - without structs? Ian Collins <ian-news@hotmail.com> - 2015-08-18 11:11 +1200
    Re: type safety on simple data types - without structs? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-08-18 18:16 +0000
  Re: type safety on simple data types - without structs? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-18 04:14 -0700
    Re: type safety on simple data types - without structs? mathog <dmathog@gmail.com> - 2015-08-21 13:47 -0700

csiph-web