Function prototypes (section 6.9.1, paragraph 14) – Altera Nios II C2H Compiler User Manual
Page 131
Altera Corporation
9.1
7–7
November 2009
Nios II C2H Compiler User Guide
ANSI C Compliance and Restrictions
Function Prototypes (Section 6.9.1, Paragraph 14)
A function prototype cannot be encapsulated within a function.
For example, the following code is not supported:
void doDMA(int a)
{
void analyze(int i);
...
}
The C2H Compiler supports separate declarations of functions, as
follows:
void analyze(int i);
void doDMA(int a)
{
...
}
Recursive Function Calls (Section 6.5.2.2, Paragraph 11)
Recursive function calls are not supported.
shows an unsupported recursive implementation of the
factorial function.
Example 7–2. Recursive Implementation of Factorial Function
int factorial(int x)
{
if (x>1) return factorial(x-1) * x;
else return x;
}
You can replace recursive functions with equivalent code that
implements the function without using recursion.
shows an
equivalent implementation of the factorial function without using
recursion.
- MAX 10 JTAG (15 pages)
- MAX 10 Power (21 pages)
- Unique Chip ID (12 pages)
- Remote Update IP Core (43 pages)
- Device-Specific Power Delivery Network (28 pages)
- Device-Specific Power Delivery Network (32 pages)
- Hybrid Memory Cube Controller (69 pages)
- ALTDQ_DQS IP (117 pages)
- MAX 10 Embedded Memory (71 pages)
- MAX 10 Embedded Multipliers (37 pages)
- MAX 10 Clocking and PLL (86 pages)
- MAX 10 FPGA (26 pages)
- MAX 10 FPGA (56 pages)
- USB-Blaster II (22 pages)
- GPIO (22 pages)
- LVDS SERDES (27 pages)
- User Flash Memory (33 pages)
- ALTDQ_DQS2 (100 pages)
- Avalon Tri-State Conduit Components (18 pages)
- Cyclone V Avalon-MM (166 pages)
- Cyclone III FPGA Starter Kit (36 pages)
- Cyclone V Avalon-ST (248 pages)
- Stratix V Avalon-ST (286 pages)
- Stratix V Avalon-ST (293 pages)
- DDR3 SDRAM High-Performance Controller and ALTMEMPHY IP (10 pages)
- Arria 10 Avalon-ST (275 pages)
- Avalon Verification IP Suite (224 pages)
- Avalon Verification IP Suite (178 pages)
- FFT MegaCore Function (50 pages)
- DDR2 SDRAM High-Performance Controllers and ALTMEMPHY IP (140 pages)
- Floating-Point (157 pages)
- Integer Arithmetic IP (157 pages)
- Embedded Peripherals IP (336 pages)
- JESD204B IP (158 pages)
- Low Latency Ethernet 10G MAC (109 pages)
- LVDS SERDES Transmitter / Receiver (72 pages)
- Nios II Embedded Evaluation Kit Cyclone III Edition (3 pages)
- Nios II Embedded Evaluation Kit Cyclone III Edition (80 pages)
- IP Compiler for PCI Express (372 pages)
- Parallel Flash Loader IP (57 pages)
- RAM-Based Shift Register (26 pages)
- RAM Initializer (36 pages)
- Phase-Locked Loop Reconfiguration IP Core (51 pages)
- DCFIFO (28 pages)