-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.developers
55 lines (38 loc) · 1.88 KB
/
README.developers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Information for developers on UNIX/Linux
----------------------------------------
The plplot build system now requires CMake. The latest instructions for
building PLplot with cmake can be found on the PLplot wiki.
http://www.miscdebris.net/plplot_wiki
Coding standards for PLplot
---------------------------
When writing / contributing code for PLplot the following standards are
followed:
C: ISO C99 standards with POSIX.1-2001 base specification (required
for a number of functions)
C++: ISO C++ 1998 standard plus amendents
Fortran 95: Fortran 95 standard
To check code it is recommended to try compiling with suitable compiler
flags to enforce these standards and to enable compiler warnings to check
for dubious code.
For gcc / g++ / gfortran the following flags can be used
CFLAGS='-O3 -std=c99 -pedantic -D_POSIX_C_SOURCE=200112L -Wall \
-Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
-Wconversion -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings'
CCFLAGS='-O3 -fvisibility=hidden -std=c++98 -pedantic -Wall -Wextra'
FFLAGS='-std=f95 -O3 -fall-intrinsics -fvisibility=hidden -pedantic \
-Wall -Wextra'
Adherence to the standards should help make the code more portable.
Some notes and recommendations
------------------------------
- Use C++ style // comments rather than the older /* */ style comments.
The only exception to this where a comment is embeded in a line of code,
e.g. to comment out a parameter name in a function definition in C++.
- To mark function parameters as unused and to suppress at least gcc
warnings about these, mark the parameter names with the PL_UNUSED( )
macro.
Styling of code
---------------
The uncrustify code beautifying program is used to style the source
code consistently and in a readable manner. Running the
scripts/style_source.sh shell script can be used the check the
source code, and to apply any styling changes required.