Author Topic: the c-semantics project is aimed against - C undefined behavior -  (Read 22318 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the c-semantics project is aimed against - C undefined behavior -
« Reply #75 on: March 28, 2014, 01:20:37 pm »
Quote
Cyclone is a safe dialect of C.

Cyclone is like C: it has pointers and pointer arithmetic, structs, arrays, goto, manual memory management, and C’s preprocessor and syntax.
Cyclone adds features such as pattern matching, algebraic datatypes, exceptions, region-based memory management, and optional garbage collection.
Cyclone is safe: pure Cyclone programs are not vulnerable to a wide class of bugs that plague C programs: buffer overflows, format string attacks, double free bugs, dangling pointer accesses, etc.

have you seen Cyclone programming language ?

Unfortunately the last version was released on 2006 and … it seems dead, also issues with modern gcc compilers.
 

Offline tjaeger

  • Regular Contributor
  • *
  • Posts: 101
Re: the c-semantics project is aimed against - C undefined behavior -
« Reply #76 on: March 28, 2014, 03:49:59 pm »
the issue seems related to uint64_t
There is no issue.  memcpy() is undefined for overlapping memory areas, so compilers can do whatever they want.
 

Offline GiskardReventlov

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
  • How many pseudonyms do you have?
Re: the c-semantics project is aimed against - C undefined behavior -
« Reply #77 on: March 28, 2014, 09:22:58 pm »
kicad is written in C++, so this won't work.  Even if it were written in C, I doubt kcc could handle a project of this scale.

You know I knew kicad was written in C++.... Well anyway I will try it out on some other C code. I think Bind is C.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the c-semantics project is aimed against - C undefined behavior -
« Reply #78 on: March 28, 2014, 10:05:48 pm »
have you seen Cyclone ?

i'd like to compile it but it seems to have issues with modern compiler/system, i am having issues with gentoo/x86 with gcc-3.4.6

also, anybody has tried to compile and install the C-semantics tool ?

I am considering both these tools as "C validators", about this .. do you know good MISRA C validator ? Anything commercial (but cheap) or open source around ?
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4382
  • Country: us
Re: the c-semantics project is aimed against - C undefined behavior -
« Reply #79 on: March 29, 2014, 03:07:36 am »
Quote
programmers can take advantage of assumptions about the underlying architecture.  ... These ideas often work in concert to yield intricate, platform-dependent bugs
I'm not sure about that "often" part.
Yes, C has a bunch of "undefined" and implementation-dependent areas that can be annoying.
(and probably impossible to fix, although not necessarily impossible to check for.  Endianness?)

But I bet you could fix more actual real-world bugs by adding a "string" datatype and associated set of functions and operators, and having people use them when they needed, you know, STRINGS.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: the c-semantics project is aimed against - C undefined behavior -
« Reply #80 on: March 29, 2014, 05:01:30 pm »
Quote
do you know good MISRA C validator ?

Lint is widely used.

I personally use IAR's built-in misra validators - not as elaborate but good compromise between functionality and costs. You can also try greenhill but they are pricey.

MISRA to me is the starting point of good coding habits / common sense practice. If you can be 90% MISRA compliant, you are doing a very good job.
================================
https://dannyelectronics.wordpress.com/
 

Offline Q-Kernel

  • Contributor
  • Posts: 13
Re: the c-semantics project is aimed against - C undefined behavior -
« Reply #81 on: April 02, 2014, 03:10:26 am »
do you know good MISRA C validator ? Anything commercial (but cheap) or open source around ?

PC-Lint $389
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf