Project

General

Profile

Actions

Task #3443

closed

Research: use c11 standard

Added by Victor Julien over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Effort:
Difficulty:
Label:

Description

Currently we use c99, or rather gnu99. c11 brings some nice improvements like thread local, atomics, anonymous structs and unions.

First step is to investigate if all platforms have a c11 compliant compiler available.


Related issues 2 (1 open1 closed)

Related to Suricata - Optimization #3655: default to c11 standardClosedVictor JulienActions
Related to Suricata - Task #6029: c: require C11AssignedJeff LucovskyActions
Actions #1

Updated by Victor Julien over 4 years ago

CentOS 6's gcc is too old. A c11 version can be installed through 'scl'. See for example https://edwards.sdsu.edu/research/c11-on-centos-6/

Actions #2

Updated by Victor Julien over 4 years ago

Snippet from my Gitlab-CI centos:6 builder:

centos:6:scl:
  image: centos:6
  stage: test
  before_script:
    - source setupenv.sh
    - yum -y install epel-release centos-release-scl
    - yum -y install devtoolset-8
    - source /opt/rh/devtoolset-8/enable
    ...

This gets us:
GCC version 8.3.1 20190311 (Red Hat 8.3.1-3), C version 199901

Actions #3

Updated by Victor Julien over 4 years ago

Probably a stretch, but for good measure we should consider c18 while at it.

Actions #4

Updated by Victor Julien about 4 years ago

Actions #5

Updated by Victor Julien about 4 years ago

  • Status changed from New to Closed

c18 is too recent for us. Support is absent in many of the supported platforms. c11 support has been added #3655.

Actions #6

Updated by Victor Julien 12 months ago

Actions

Also available in: Atom PDF