Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • src
  • Issues
  • #487

Closed
Open
Created Mar 18, 2020 by snuverink_j@snuverink_jDeveloper

Clang compiler warning for IntTSC (-Wsign-compare)

Summary

Clang compiler warning for IntTSC (-Wsign-compare).

Steps to reproduce

-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90

Relevant logs and/or screenshots

ippl/src/Particle/IntTSC.h:284:8: error: comparison of integers of
      different signs: 'unsigned int' and 'int' [-Werror,-Wsign-compare]
                if (p==-1) return .125*(1.-4.*dpos(i)+4.*dpos(i)*dpos(i));
                    ~^ ~~

and many similar ones

Possible fixes

The warning comes from https://gitlab.psi.ch/OPAL/src/blob/master/ippl/src/Particle/IntTSC.h#L283

	auto W = [dpos](unsigned p, unsigned i) {
		if (p==-1) return .125*(1.-4.*dpos(i)+4.*dpos(i)*dpos(i));
		else if (p==0) return .25*(3.-4.*dpos(i)*dpos(i));
		else if (p==+1) return .125*(1.+4.*dpos(i)+4.*dpos(i)*dpos(i)); };

p should be a signed integer instead of unsiged.

Edited Mar 18, 2020 by snuverink_j
Assignee
Assign to
OPAL 2.4.0
Milestone
OPAL 2.4.0 (Past due)
Assign milestone
Time tracking