реклама на сайте
подробности

 
 
> Gcc, выдает варнинг вместо ошибки.
ar__systems
сообщение Oct 7 2013, 15:19
Сообщение #1


self made
****

Группа: Свой
Сообщений: 855
Регистрация: 7-03-09
Из: Toronto, Canada
Пользователь №: 45 795



Код
void Dummy(int* a) {
    *a = 0;
};

void Test() {
  int* a = 0;
  Dummy(&a);
};


Выдает варнинг, тогда как я бы хотел видеть в этом месте ошибку. Как переключить?

test.c:1076:3: warning: passing argument 1 of 'Dummy' from incompatible p
inter type [enabled by default]
test_emac.c:873:6: note: expected 'int *' but argument is of type 'int **'
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
Ixt
сообщение Oct 8 2013, 15:44
Сообщение #2


Частый гость
**

Группа: Свой
Сообщений: 76
Регистрация: 27-10-06
Из: Брянск
Пользователь №: 21 724



Да, предлагаю. Как я понял, вы готовы в некоторой мере на эту работу.

Кстати, у Werror есть 2 метода использования. Возможно вам больше подойдёт второй:

Цитата
-Werror
Make all warnings into errors.
-Werror=
Make the specified warning into an error. The specifier for a warning is appended, for example -Werror=switch turns the warnings controlled by -Wswitch into errors. This switch takes a negative form, to be used to negate -Werror for specific warnings, for example -Wno-error=switch makes -Wswitch warnings not be errors, even when -Werror is in effect. You can use the -fdiagnostics-show-option option to have each controllable warning amended with the option which controls it, to determine what to use with this option.

Note that specifying -Werror=foo automatically implies -Wfoo. However, -Wno-error=foo does not imply anything.
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 21:26
Рейтинг@Mail.ru


Страница сгенерированна за 0.01364 секунд с 7
ELECTRONIX ©2004-2016