mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-05-01 22:57:33 +02:00
Merge branch 'feat/warnings'
This enables fwbuilder to compile with -Wall -Werror on Clang/OSX
This commit is contained in:
commit
5e39344038
@ -52,6 +52,7 @@ public:
|
||||
static std::map<QString,int> name_disambiguation;
|
||||
|
||||
NamedObject(const libfwbuilder::FWObject *obj, const QString &platform);
|
||||
virtual ~NamedObject() {}
|
||||
virtual QString getCommand();
|
||||
virtual QString getCommandWhenObjectGroupMember();
|
||||
QString getName() { return name; }
|
||||
|
||||
@ -510,9 +510,12 @@ public:
|
||||
fwcompiler::OSConfigurator *_oscnf);
|
||||
virtual ~PolicyCompiler_cisco() {}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
virtual std::string createRuleLabel(const std::string &txt,
|
||||
libfwbuilder::Interface *iface,
|
||||
int rule_num);
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
virtual int prolog();
|
||||
virtual void compile();
|
||||
|
||||
@ -72,6 +72,8 @@ PolicyRule* AutomaticRules::addMgmtRule(
|
||||
const string &label,
|
||||
bool related)
|
||||
{
|
||||
(void) related; // Unused
|
||||
|
||||
if (ruleset == NULL) return NULL;
|
||||
|
||||
/* Insert PolicyRules at top so they do not get shadowed by other
|
||||
|
||||
@ -52,6 +52,8 @@ bool junosInterfaces::basicValidateInterfaceName(Interface *,
|
||||
const QString &obj_name,
|
||||
QString &err)
|
||||
{
|
||||
(void) obj_name; (void) err; // Unused
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -59,6 +61,8 @@ bool junosInterfaces::isValidVlanInterfaceName(const QString &subint_name,
|
||||
const QString &parent_name,
|
||||
QString &err)
|
||||
{
|
||||
(void) parent_name; // Unused
|
||||
|
||||
if (!looksLikeVlanInterface(subint_name))
|
||||
{
|
||||
err = QObject::tr("'%1' is not a valid unit name")
|
||||
|
||||
@ -65,6 +65,8 @@ bool linux24Interfaces::basicValidateInterfaceName(Interface *intf,
|
||||
const QString &obj_name,
|
||||
QString &err)
|
||||
{
|
||||
(void) intf; // Unused
|
||||
|
||||
if (obj_name.indexOf(' ') != -1)
|
||||
{
|
||||
err = QObject::tr("Bridge interface name '%1' can not contain white space").arg(obj_name);
|
||||
|
||||
@ -155,7 +155,10 @@ public:
|
||||
// and does final clean up.
|
||||
virtual libfwbuilder::Firewall* finalize();
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
virtual libfwbuilder::FWObject* makeAddressObj(AddressSpec &as);
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
virtual void addSrc();
|
||||
virtual void addDst();
|
||||
|
||||
@ -193,7 +193,10 @@ public:
|
||||
virtual void* dispatch(libfwbuilder::DNSName*, void*);
|
||||
virtual void* dispatch(libfwbuilder::ObjectGroup*, void*);
|
||||
virtual void* dispatch(libfwbuilder::ServiceGroup*, void*);
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
virtual void* dispatch(libfwbuilder::AttachedNetworks*, void*);
|
||||
#pragma clang diagnostic pop
|
||||
virtual void* dispatch(libfwbuilder::UserService*, void*);
|
||||
virtual void* dispatch(libfwbuilder::DynamicGroup*, void*);
|
||||
|
||||
|
||||
@ -654,7 +654,7 @@ int OSConfigurator_secuwall::generateInterfaceFile (Interface * iface, string na
|
||||
stream << "\"" << endl;
|
||||
|
||||
/* Address object contains host, network and broadcast address plus netmask */
|
||||
const Address* ipAddr;
|
||||
const Address* ipAddr = NULL;
|
||||
if (ip_address != NULL)
|
||||
ipAddr = ip_address->getAddressObject();
|
||||
|
||||
|
||||
@ -113,6 +113,8 @@ void expand_interface_with_phys_address(Compiler *compiler,
|
||||
std::list<FWObject*> &ol1,
|
||||
std::list<FWObject*> &list_result)
|
||||
{
|
||||
(void) rule; // Unused
|
||||
|
||||
std::list<FWObject*> lipaddr;
|
||||
std::list<FWObject*> lother;
|
||||
physAddress *pa = NULL;
|
||||
|
||||
@ -528,6 +528,8 @@ void PolicyCompiler_junosacl::compile()
|
||||
|
||||
string PolicyCompiler_junosacl::printAccessGroupCmd(ciscoACL *acl, bool neg)
|
||||
{
|
||||
(void) neg; // Unused
|
||||
|
||||
ostringstream str;
|
||||
|
||||
string addr_family_prefix = "inet";
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include "config.h"
|
||||
#include "fwbuilder/libfwbuilder-config.h"
|
||||
@ -77,10 +78,14 @@ FWObject& AddressRange::shallowDuplicate(const FWObject *o, bool preserve_id)
|
||||
throw(FWException)
|
||||
{
|
||||
const AddressRange *n = dynamic_cast<const AddressRange *>(o);
|
||||
if (n==NULL)
|
||||
throw(FWException(
|
||||
"Attempt to copy incompatible object to AddressRange: objectID="+o->getId()));
|
||||
if (n==NULL) {
|
||||
|
||||
std::ostringstream s;
|
||||
s << "Attempt to copy incompatible object to AddressRange: objectID=";
|
||||
s << o->getId();
|
||||
|
||||
throw(FWException(s.str()));
|
||||
}
|
||||
start_address = n->getRangeStart();
|
||||
end_address = n->getRangeEnd();
|
||||
|
||||
|
||||
@ -123,6 +123,8 @@ xmlNodePtr DNSName::toXML(xmlNodePtr parent) throw(FWException)
|
||||
void DNSName::loadFromSource(bool ipv6, FWOptions *options,
|
||||
bool test_mode) throw(FWException)
|
||||
{
|
||||
(void) options; // Unused
|
||||
|
||||
int af_type = (ipv6)?AF_INET6:AF_INET;
|
||||
try
|
||||
{
|
||||
|
||||
@ -148,6 +148,8 @@ bool DynamicGroup::isCompileTime() const
|
||||
void DynamicGroup::loadFromSource(bool ipv6, FWOptions *options, bool test_mode)
|
||||
throw (FWException)
|
||||
{
|
||||
(void) ipv6; (void) options; (void) test_mode; // Unused
|
||||
|
||||
FWObjectDatabase *root = getRoot();
|
||||
|
||||
FWObject::tree_iterator tree_iter;
|
||||
|
||||
@ -109,8 +109,9 @@ bool FWReference::cmp(const FWObject *obj, bool /* UNUSED recursive */) throw(FW
|
||||
return true;
|
||||
}
|
||||
|
||||
void FWReference::add(FWObject*)
|
||||
void FWReference::add(FWObject*,bool validate)
|
||||
{
|
||||
(void) validate; // Unused
|
||||
throw std::string("Can't add to a reference !");
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
|
||||
virtual bool cmp(const FWObject *obj, bool recursive=false) throw(FWException);
|
||||
|
||||
virtual void add(FWObject *obj);
|
||||
virtual void add(FWObject *obj,bool validate=true);
|
||||
|
||||
virtual FWObject *getPointer();
|
||||
virtual int getPointerId();
|
||||
|
||||
@ -1044,7 +1044,7 @@ RuleElementRItf* RoutingRule::getRItf() const
|
||||
}
|
||||
|
||||
|
||||
bool RoutingRule::isEmpty() const
|
||||
bool RoutingRule::isEmpty()
|
||||
{
|
||||
RuleElement *rdst=getRDst();
|
||||
RuleElement *rgtw=getRGtw();
|
||||
|
||||
@ -439,7 +439,7 @@ class RoutingRule : public Rule
|
||||
|
||||
RoutingRuleTypes rule_type;
|
||||
std::string sorted_dst_ids;
|
||||
int ecmp_id;
|
||||
// int ecmp_id; // Unused
|
||||
|
||||
public:
|
||||
|
||||
@ -460,7 +460,7 @@ class RoutingRule : public Rule
|
||||
|
||||
virtual FWOptions* getOptionsObject() const;
|
||||
virtual RuleSet* getBranch();
|
||||
virtual bool isEmpty() const;
|
||||
virtual bool isEmpty();
|
||||
|
||||
int getMetric() const;
|
||||
void setMetric(int metric);
|
||||
|
||||
@ -1001,7 +1001,11 @@ public:
|
||||
Compiler(libfwbuilder::FWObjectDatabase *_db,
|
||||
libfwbuilder::Firewall *fw, bool ipv6_policy,
|
||||
fwcompiler::OSConfigurator *_oscnf);
|
||||
|
||||
/*
|
||||
* TODO: Refactor Compiler to not hide BaseCompiler
|
||||
*/
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
Compiler(libfwbuilder::FWObjectDatabase *_db, bool ipv6_policy);
|
||||
|
||||
/**
|
||||
@ -1016,6 +1020,7 @@ public:
|
||||
|
||||
virtual void warning(const std::string &errstr);
|
||||
virtual void warning(libfwbuilder::FWObject *rule, const std::string &errstr);
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
void setDebugLevel(int dl) { debug=dl; }
|
||||
void setDebugRule(int dr) { debug_rule = dr; rule_debug_on = true; }
|
||||
|
||||
@ -48,6 +48,8 @@ QWidget *DynamicItemDelegate::createEditor(QWidget *parent,
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
Q_UNUSED(option)
|
||||
|
||||
if (index.column() == 0) {
|
||||
QToolButton *button = new QToolButton(parent);
|
||||
QPixmap pixmap;
|
||||
@ -71,6 +73,8 @@ QWidget *DynamicItemDelegate::createEditor(QWidget *parent,
|
||||
|
||||
void DynamicItemDelegate::comboActivated(int abc)
|
||||
{
|
||||
Q_UNUSED(abc)
|
||||
|
||||
/* Don't wait until we lose focus on the combobox */
|
||||
emit commitData(dynamic_cast<QWidget *>(sender()));
|
||||
}
|
||||
@ -307,6 +311,7 @@ void DynamicGroupDialog::loadFWObject(FWObject *o)
|
||||
|
||||
void DynamicGroupDialog::validate(bool *result)
|
||||
{
|
||||
Q_UNUSED(result)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ class HttpGet : public QObject
|
||||
|
||||
public:
|
||||
HttpGet(QObject *parent = 0);
|
||||
bool get(const QUrl &url) { return false; }
|
||||
bool get(const QUrl &url) { Q_UNUSED(url) return false; }
|
||||
QString getLastError() { return QString("HttpGet is disabled when compiled with Qt 5"); }
|
||||
bool getStatus() { return false; }
|
||||
QString toString() { return QString(); }
|
||||
@ -85,7 +85,7 @@ signals:
|
||||
void done(const QString &res);
|
||||
|
||||
private slots:
|
||||
void httpDone(int id, bool error) {}
|
||||
void httpDone(int id, bool error) { Q_UNUSED(id) Q_UNUSED(error) }
|
||||
void fileDone() {}
|
||||
};
|
||||
|
||||
|
||||
@ -558,7 +558,7 @@ FWObject* ObjectManipulator::newCluster(QUndoCommand* macro, bool fromSelected)
|
||||
fwvector.push_back(FWObject::cast(fw));
|
||||
ncd->setFirewallList(fwvector);
|
||||
}
|
||||
if ( ! ncd->exec() == QDialog::Accepted) return NULL;
|
||||
if ( ncd->exec() != QDialog::Accepted) return NULL;
|
||||
|
||||
FWObject *ncl = ncd->getNewCluster();
|
||||
delete ncd;
|
||||
|
||||
@ -1271,6 +1271,7 @@ int RuleSetModel::getRulePosition(QModelIndex index)
|
||||
|
||||
void RuleSetModel::objectChanged(FWObject* object)
|
||||
{
|
||||
Q_UNUSED(object)
|
||||
/*
|
||||
* See #2373
|
||||
*
|
||||
|
||||
@ -2861,6 +2861,9 @@ void RuleSetView::updateColumnSizeForIndex(QModelIndex index)
|
||||
|
||||
void RuleSetView::updateSectionSizesForIndex(QModelIndex idx1, QModelIndex idx2)
|
||||
{
|
||||
Q_UNUSED(idx1)
|
||||
Q_UNUSED(idx2)
|
||||
|
||||
updateAllColumnsSize();
|
||||
}
|
||||
|
||||
|
||||
@ -612,7 +612,7 @@ QSize RuleSetViewDelegate::calculateCellSizeForObject(const QModelIndex & index)
|
||||
}
|
||||
}
|
||||
QSize res = QSize(w+HORIZONTAL_MARGIN*2,h);
|
||||
QModelIndex idx = index;
|
||||
// QModelIndex idx = index; // Unused
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,16 @@ SSHJunos::SSHJunos(QWidget *_par,
|
||||
enable_prompt="> $"; // operational prompt
|
||||
config_prompt="# $"; // configuration prompt
|
||||
pwd_prompt_1="'s password: $";
|
||||
/*
|
||||
* TODO
|
||||
* Do not change pwd_prompt_2 without extensive testing
|
||||
* This must be tested on actual hardware/os
|
||||
* Will prevent login on wrong regex, with silent error - timeout
|
||||
*/
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunknown-escape-sequence"
|
||||
pwd_prompt_2="Password:\w?";
|
||||
#pragma clang diagnostic pop
|
||||
epwd_prompt="Password: ";
|
||||
ssh_pwd_prompt="'s password: ";
|
||||
ssoft_config_prompt="> ";
|
||||
|
||||
@ -38,6 +38,8 @@ TutorialDialog::TutorialDialog(QString tutorial, QWidget *parent) :
|
||||
QDialog(NULL),
|
||||
ui(new Ui::TutorialDialog_q)
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint);
|
||||
#if QT_VERSION >= 0x040500
|
||||
|
||||
@ -98,6 +98,8 @@ static bool decendingLessThan(const _item_data &s1, const _item_data &s2)
|
||||
|
||||
void ListOfLibrariesModel::sort(int column, Qt::SortOrder order)
|
||||
{
|
||||
Q_UNUSED(column)
|
||||
|
||||
QList<_item_data> list;
|
||||
for (int i=0; i<rowCount(); ++i)
|
||||
{
|
||||
|
||||
@ -71,7 +71,10 @@ public:
|
||||
libfwbuilder::FWObject* getLibrary(QModelIndex idx);
|
||||
libfwbuilder::FWObject* getLibrary(int row);
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
void setData(QModelIndex idx, const QString &name, libfwbuilder::FWObject *lib, ObjectTreeView *otv);
|
||||
#pragma clang diagnostic pop
|
||||
void setName(QModelIndex idx, const QString &name);
|
||||
|
||||
ObjectTreeView* getTreeWidget(QModelIndex idx);
|
||||
|
||||
@ -100,7 +100,7 @@ void newClusterDialog::setFirewallList(std::vector<libfwbuilder::FWObject*> data
|
||||
{
|
||||
m_dialog->interfaceSelector->clear();
|
||||
firewallList.clear();
|
||||
typedef QPair<Firewall*, bool> fwpair;
|
||||
//typedef QPair<Firewall*, bool> fwpair; // Unused
|
||||
foreach ( FWObject *fw, data )
|
||||
firewallList.push_back(Firewall::cast(fw));
|
||||
m_dialog->firewallSelector->setFirewallList(firewallList, select);
|
||||
|
||||
@ -96,6 +96,7 @@ QString CompilerDriver_ipf::composeActivationCommand(libfwbuilder::Firewall *fw,
|
||||
|
||||
QString CompilerDriver_ipf::assembleManifest(Cluster*, Firewall* fw, bool )
|
||||
{
|
||||
(void) fw; // Unused
|
||||
QString remote_name = remote_file_names[FW_FILE];
|
||||
QString remote_ipf_name = remote_file_names[CONF1_FILE];
|
||||
QString remote_nat_name = remote_file_names[CONF2_FILE];
|
||||
|
||||
@ -235,7 +235,10 @@ namespace fwcompiler {
|
||||
virtual std::string _printPort(int rs,int re,bool neg=false);
|
||||
virtual void _printWith(libfwbuilder::Service *srv);
|
||||
virtual void _printAction(libfwbuilder::PolicyRule *r);
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
virtual void _printAddr(libfwbuilder::Address *o,bool neg=false);
|
||||
#pragma clang diagnostic pop
|
||||
virtual void _printDstService(libfwbuilder::RuleElement *o);
|
||||
|
||||
public:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user