Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]:Asterisk make now requires ASTCFLAGS='-std=gnu99 -Wdeclaration-after-statement' #275

Closed
1 task done
AstersikRoss opened this issue Aug 26, 2023 · 0 comments · Fixed by #283
Closed
1 task done
Assignees
Labels
bug support-level-core Functionality with core support level

Comments

@AstersikRoss
Copy link
Contributor

Severity

Trivial

Versions

18, 20, 21, master

Components/Modules

app_voicemail

Operating Environment

CentOS

Frequency of Occurrence

Constant

Issue Description

When compiling asterisk 18 from GIT the following errors are now encountered due to the compile flag 'c99' not being set.

This appears to be due to the fix for issue #170

Relevant log output

app_voicemail.c: In function ‘show_mailbox_snapshot’:
app_voicemail.c:11594:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < mailbox_snapshot->folders; i++) {
  ^
app_voicemail.c:11594:2: note: use option -std=c99 or -std=gnu99 to compile your code
app_voicemail.c: In function ‘complete_voicemail_move_message’:
app_voicemail.c:11813:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (int i = 0; i < ARRAY_LEN(mailbox_folders); i++) {
   ^
app_voicemail.c: In function ‘append_vmbox_info_astman’:
app_voicemail.c:13818:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < mailbox_snapshot->folders; i++) {
  ^
app_voicemail.c: At top level:
cc1: warning: unrecognized command line option "-Wno-format-truncation" [enabled by default]
make[1]: *** [app_voicemail.o] Error 1
make: *** [apps] Error 2
   [CCi] app_voicemail.i -> app_voicemail.o
app_voicemail.c: In function ‘show_mailbox_snapshot’:
app_voicemail.c:11594:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < mailbox_snapshot->folders; i++) {
  ^
app_voicemail.c:11594:2: note: use option -std=c99 or -std=gnu99 to compile your code
app_voicemail.c: In function ‘complete_voicemail_move_message’:
app_voicemail.c:11813:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (int i = 0; i < ARRAY_LEN(mailbox_folders); i++) {
   ^
app_voicemail.c: In function ‘append_vmbox_info_astman’:
app_voicemail.c:13818:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < mailbox_snapshot->folders; i++) {
  ^
app_voicemail.c: At top level:
cc1: warning: unrecognized command line option "-Wno-format-truncation" [enabled by default]
make[1]: *** [app_voicemail.o] Error 1
make: *** [apps] Error 2
if [ ! -d "/etc/asterisk/../logrotate.d" ]; then \
        /usr/bin/install -c -d "/etc/asterisk/../logrotate.d" ; \
fi

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines
@AstersikRoss AstersikRoss changed the title [bug]:Asterisk Compile now requires C99 mode [bug]:Asterisk make now requires ASTCFLAGS='-std=gnu99 -Wdeclaration-after-statement' Aug 26, 2023
@jcolp jcolp added the support-level-core Functionality with core support level label Aug 26, 2023
@gtjoseph gtjoseph removed the triage label Aug 28, 2023
mbradeen added a commit to mbradeen/asterisk that referenced this issue Aug 29, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: asterisk#275
asterisk-org-access-app bot pushed a commit that referenced this issue Aug 30, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
asterisk-org-access-app bot pushed a commit that referenced this issue Aug 30, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
asterisk-org-access-app bot pushed a commit that referenced this issue Aug 30, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
asterisk-org-access-app bot pushed a commit that referenced this issue Aug 30, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
asterisk-org-access-app bot pushed a commit that referenced this issue Aug 30, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
asterisk-org-access-app bot pushed a commit that referenced this issue Sep 6, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
(cherry picked from commit 62480fd)
asterisk-org-access-app bot pushed a commit that referenced this issue Sep 6, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
(cherry picked from commit 36b749d)
asterisk-org-access-app bot pushed a commit that referenced this issue Sep 6, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
(cherry picked from commit e9b2696)
asterisk-org-access-app bot pushed a commit that referenced this issue Sep 6, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
(cherry picked from commit e9b2696)
asterisk-org-access-app bot pushed a commit that referenced this issue Sep 6, 2023
Resolve for loop initial declarations added in cli changes.

Resolves: #275
(cherry picked from commit e9b2696)
asterisk-org-access-app bot pushed a commit that referenced this issue Feb 21, 2024
Resolve for loop initial declarations added in cli changes.

Resolves: #275
(cherry picked from commit 8f5fb2a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug support-level-core Functionality with core support level
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants